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

Date Range Calculation

Status
Not open for further replies.
Dec 9, 2003
1
US
In our SQl database our projects have a start and an end date. I am trying to calculate the number of days that each project lasts. I have tried both

DateDiff ('D', startdate, enddate)
and
(enddate - startdate)

and I get the same results. All projects equal to zero days whether it was the same date or 15 days difference in the start and end dates.

Thoughts?

 
EndDate - StartDate should work.

What format are the StartDate and EndDate fields in the SQL database - Dates, DateTimes, Strings?
 
I believe that it's case sensitive, use a lowercase d, but the enddate - startdate should work fine. Try right clicking this date field and selecting browse data and post what the type of data is, and what's being displayed.

Also try posting technical inforamtion, such as Crystal version and the database used (a SQL database could be numerous as it's a language, perhaps you mean a SQL Server database)

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top