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

Grouping by weekly date.

Status
Not open for further replies.

tomcram

Technical User
Mar 2, 2002
1
GB
I have written a report using a Visual Foxpro data source.
I have 1 little problem. I am grouping the data by transaction date with totals for the week. I selected to group by and then weekly. I want the date shown for each week to be the date on Sunday every week. At present it is picking up the first transaction date in a particular week and printing that as the date. I need a formula that will do this for me but it's really got me puzzled. Anybody got any ideas?
 
Write a formula that finds the next sunday. The If statement checks to see if the date is already a sunday, and if it is not, thr formula will add the appropriate number of days to find the next sunday.

If Dayofweek({date}) =1 then {date} else
Dateadd("d",(8-DayofWeek({date})),{date})

Then group on this formula. Software Support for Macola, Crystal Reports and Goldmine
dgillz@juno.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top