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

How do I exact a Time from a DateTime Field?

Status
Not open for further replies.

Mailpack

MIS
May 19, 2003
12
GB
In the AS/400 Database, I have several DateTime fields.

I need to be able to Extract the time portion for Calculation Purposes.

There is a Datetime to Date function, but not DateTime to Time?

Regards

Roger Pearson
 
For calculations, I use
Code:
[i]mydate[/i] - datetime-to-date([i]mydate[/i])
to give a value (mydate being a datetime field)

If it's for inclusion in a string, then the number-to-string-padded function in combination with the hour or minute function gives a satisfactory result.


soi la, soi carré
 
Thank you very much.

That hit the spot !!

Regards

Roger Pearson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top