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

Date Difference 1

Status
Not open for further replies.

moyerw

Technical User
Jul 19, 2005
4
CA
I am new to Crystal Reports and trying to figure out what some of the lingo means. Here is the syntax I need to use:

DateDiff(intervalType, startDateTime, endDateTime)

I need to know the difference in days only from todays date (startDateTime) to a work order date in a database, which I will use the correct work order field for "endDateTime". I don't know what to use for "startDateTime", nor do I know what "intervalType" is.

Can anyone enlighten me? I apologize for asking a simple question ... again, I am just a beginner. Thanks.

Wanda
 
Wanda,

You should have helpfiles installed with your version of Crystal Reports. F1, or the Help menu will take you to a comprehensive glossary of Crystal functions.

For your purposes, this is how you would interpret the datediff function.

Datediff('d' ['d' for days, 'm' for month, etc], CurrentDate [representing todays date],{Your.DatabaseDate}).

This returns the number of days between today and a date in the future.

Naith
 
Thank you very much Naith. This worked. This is what I originally had:

DateDiff({DD},{Now},{Work_Orders.Open Date & Time})

It did not like {DD} nor {Now}. I see what you did. I am looking in the Help section and still struggling with it somewhat. I have taken "Basic Crystal Reports Course" and "Level 2 Crystal Reports course." Class work is much easier then the real world.

I have one more question. It is a parameter question. I will post it as a new one.

Thanks again. Very much appreciated.

Wanda
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top