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!

Creating a Week Function

Status
Not open for further replies.

SunTrustER

Programmer
Jan 24, 2001
8
US
I am using Crystal Reports version 7.0.100.15 going against SQL server, version 7. I am trying to create a "week function" and group and total on that function. The week function would run from Monday to Saturday. For example, I would the report to show 1/8/2001 (Monday) to 1/13/2001 (Saturday). I would want to do a count showing all loans applied for between 1/8 and 1/13 with my grouping title or label showing 1/13. If a loan occurred on Sunday, then spill over into the next week. Then i want to show 1/15 to 1/20 with my grouping title or label showing 1/20 and on and on.
 
Try the following formula:

{DateField} - DayOfWeek{DateField} + 7

This will turn any date into the Saturday at the end of that week. I am unclear on what you want to do with Sundays but try this and tell me what you think. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top