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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding first day of week without that date 1

Status
Not open for further replies.

RobbieB

Technical User
Apr 25, 2003
215
US
Crystal Developer XI
Sql database
Windowns Pro

I have written a report where we group by "Arrival Week". In the past we hard coded the weeks by the date of the Sunday starting each week. If someone has a ticket that is valid starting Thursday we want it to be part of the the group starting on the previous Sunday. I would like to wite a formula that could do this automatically. Any ideas would be appreciated. Here is a data sample for clarification.

QTY SkiDays Sales
Week Of 01/07/07
Total for advance purchases 5 29 $1,299.00
Week Of 01/14/07
Total for advance purchases 9 44 $2,242.00
Week Of 01/21/07
Total for advance purchases 16 89 $5,209.00

All tickets valid between 01/07/07 and 01/03/07 sould be under the "week of 01/07/07". All tickets valid between 01/14/07 and 01/20/07 would be part of the "Week of 01/14/07" group and so on... I was hoping to somehow use the day of week function to keep me from having to write out the range of each week at the beginning of each ski season (to update the report for the coming year).
 
If your date field is of date or datetime datatype, you can simply insert a group on your date field and choose "print on change of week" and records that fall within the week starting Sunday will automatically be included in the group.

-LB
 
Wow, It's amazing the simple things that can get by you in Crystal. Thank you Lbass. I can't believe I never knew about that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top