Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date group - for each week 1

Status
Not open for further replies.

Katy44

Technical User
Dec 12, 2003
723
GB
When I want my data grouped "for each week", how do I change the options so the dates displayed are a different day to the standard, which seems to be a Sunday?
 
You will have to derive your own week number in a formula field and then group on this.
 
So I'd have to do

if <date> between <Date1> and <Date2> (where this incorporates Thurs-Thurs)
then "Date 1 - Date 2"
if <date> between <Date2> and <Date3>
then "Date 2 - Date 3"
...etc.for as far into the future as I want to go?

Is there no way to make this a bit more automatic? Surely Crystal must have a setting somewhere for the first day of the week?
 
Thank you for your help.

I'm afraid I don't understand that bit - that formula gives me the week number for the year (1 to 53) how do I then use that to decide whether a date is before or after a Thursday?
 
Sorry, I lost track of the point of the original Q.

Use:
DatePart ("ww", {table.field},crThursday )
 
ooh that looks promising, I'll give it a go, thank you
 
That changes the week number when it reaches a thursday, so I should be able to do the rest using that. Thank you very much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top