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!

Datadate and Datatime to datetime

Status
Not open for further replies.

hpl2001

Programmer
Dec 18, 2001
105
CA
Hi:

I need to get the values of datadate and data time into one DateTime field. Does anyone know how this can be done?

Thanks.

Holly
 
Insert a text object, then drag in the Data Date field, hit the spacebar, then drag in the Data Time field.

-dave
 
Actually, I need to perform calculations on it. I need to calcualte the elapsed time between a datetime field in my database, and the datadate/datatime.
 
You can create the datetime field by using:

datetime({date.field},{time.field})

Mike
 
In Crystal 8.5, you should be able to 'bundle' them, something like
DateValue (datepart("yyyy", datadate),
datepart("m", datadate), datepart("d", datadate),
datepart("h", datatime), datepart("n", datatime))

This gives you year, month, day, hour and minute. You can then use 'DateDiff' to make comparisons, for hours it would be
DateDiff("h", @YourDate, otherdate)

Madawc Williams
East Anglia, Great Britain
 
Thank you all, that's so helpful. The datetime function was just what I was looking for!

Holly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top