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

Day of week = Sunday

Status
Not open for further replies.

rmiller11

MIS
Jan 20, 2003
43
0
0
US
I would like to get hours for a date range and only want the hours that were worked o Sunday.
Ie: if datefield = Sunday then hoursWorked

How would I do that?
 
If DayOfWeek({YourDate}) = 1
Then HoursWorked
 
In Crystal 8.5, you can test:

if DatePart("w", {datefield}) = 1

Sunday is day 1, in this system.

Madawc Williams
East Anglia, Great Britain
 
If it's for a date range, then try adding the following to Report->Edit Selection Formula:

DayOfWeek({YourDate}) = 1

You might be better served to offlaod this processing to the database, but you'll have to post technical information such as Crystal version and database used if you want specific answers.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top