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

Days between

Status
Not open for further replies.

i257156

Programmer
Sep 25, 2002
12
0
0
GB
I know that I am being really thick.. However, I need this syntax pretty quick and I haven't got time to go to the quacks to get some memory pills!

When adding a variable to count the days between is it possible to count the number of working days between? If so how the heck do you do it!!??
Thanks
JB
 
In Crystal 8.5, you can get days by
Code:
DateDiff ("d", date1, date2)
Working days is a little harder. You can identify weekends using DayOfWeek (date), Saturnday is 7 and Sunday is 1. But to allow for bank holidays etc. you'd really need to add a table of dates to your database.

Madawc Williams
East Anglia, Great Britain
 
I would suggest creating a Periods table to resolve these types of issues long term, here's a link to a FAQ for creating one in SQL Server:

faq767-4532

-k
 
Thanks guys...
Vidru's post sorted me out.
Cheers
JB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top