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!

DATEDIFF in MInutes

Status
Not open for further replies.

frieb

Technical User
Aug 8, 2005
13
US
Trying to calculate the number of minutes between two datetime stamps. Here is what I have - using Crystal 11.5:

datediff("n",{text_document.EndDictTime},({text_document.CreateTime}))

EndDictTime for this record = 7-21-2006 11:13:00
CreateTime for this reocrd = 7-22-2006 20:00:00

Above formula returns: 86400

 
Doesn't make sense, it's returning seconds for one day, perhaps you're confused about the values in the field?

Try this formula:

datediff("n",currentdatetime,currdatetime-1)

What does it return?

Then try this:

datediff("S",{text_document.EndDictTime},({text_document.CreateTime}))

What does that return?

-k
 
oops.

Formula returned 1400 in minutes and 86400 in seconds
 
So it returns the same thing for minutes and seconds (n vs. s)?

Sounds odd to me.

What does oops mean, it returned what it should for those two.

Can't think of why that would happen, always worked for me, you might use a SQL Expression and let the database do it.

-k

 
datediff("n",currentdatetime,currdatetime-1)

What does it return?
1440
 
Hmmm, then the minutes function appears to be working fine, I'd guess that you need to explore the data more closely.

-k
 
It looks as though it is only reading the date stamp and not the time stamp. Do I need to declare any variable or set any report options differently?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top