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

How to extract time from a timestamp

Status
Not open for further replies.

fubeca

Technical User
Nov 28, 2006
3
US
I'm been handed over responsibility for our FM databases. The boss used a timestamp to track the creation of our tech issues. Now the tech manager wants a report of what hours are busiest during a certain time range.

I've tried to use GetAsTime to extract the time from the timestamp but I get "17531664:00:00" instead of "8:30:56 AM". Is there a way to get just the time or to get it formatted correctly?

Thanks for your help.
 
The GetAsTime() functioin should give you the right time value.

Check if the involved fields are formatted as they should.

F.i. if the function result field is formatted as number, you will have a number...
 
I finally figured out the problem. The timestamp field had gotten changed from timestamp to date and, even though the time was visible in the field, technically the date type doesn't have a time. Thus, it ignored it and always returned 12:00:00 a.m. (in that long number format) when I used the GetAsTime. I put the field back to a timestamp and now it extracts beautifully.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top