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

Days calculation using Mid night

Status
Not open for further replies.

rupali08

Programmer
Jun 12, 2010
4
US
Can anyone help on this?I need to create a formula in Crystal Report XI which will calculate how many days are there between the start date and end date by counting how many times mid night occured between those date range.Find example below

StartDate&time:2/18/2011 1:47:02 PM
EndDate&time:2/19/2011 6:31:00 PM
Day should be =1day (as midnight occued once)

StartDate&time:2/5/2011 12:57:27 PM
EndDate&time:2/7/2011 12:45:00 PM
Day should be =2days (as midnight occued twice)
 



Hi,

It is essentially the INTEGER part of the DIFFERENCE bweteen the two date fields.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
DateDiff should do it automatically, something like
Code:
DateDiff ("d", {date1},  {date2})


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Thanks guys for your replies.it is working like a charm!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top