Get the Time of Day from a Field that is all seconds.

tambrosi
tambrosi used Ask the Experts™
on
Hope somebody can help with this one:
I have a field that is defined as having all seconds, how can I get the Time of Day out of that field.
field is 908022961 (seconds)
 to_date('19900101','yyyymmdd') + "starttime"/86400 as startDate,  (From SQL---but would like to use Crystal to get the Time of Day).
it will convert to this date 2018-10-10 with the above statement.  

Date is 10/10/2018,   but I need to find the time of day for this.  
Thanks
Terry
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
DateAdd(“s”, 908022961, “01/01/1990”) 

Open in new window

Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Try this one

Time(DateAdd('s', 908022961, Date(1900,01,01)))

mlmcc

Author

Commented:
Thanks for the input that will get me the time of day which is what I asked for.  Much appreciated.

But found out yesterday I need the mmddccyy also.  
   Found out I will have to get the mmddccyy from that string also,  is that doable also.  

Vendor defined the field as "initial start time in seconds since 1/1/1990'

Any help would be appreciated.
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
Sure

CStr(DateAdd('s', 908022961, Date(1900,01,01)), 'mmddyyyy')

mlmcc

Author

Commented:
thanks for all of the input.   It is greatly appreciated.!!!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial