Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys,
Basically I am looking at a time stamp and saying if this field is after 2pm or before 8 am the make the date associated with it one day earlier.
below is what I've tried
if(LIKP.Time_ERZET = ('14:00:00' , '00:07:59') , LIKP.CreatedOn_ERDAT = date(LIKP.CreatedOn_ERDAT -1)),
*the time field is formated in military time*
like using NOT etc. But I feel like my problem is this part ('14:00:00' , '00:07:59'). I make any date field associated with these time one day earlier.
Can anyone help?
Thanks, Alex
If your timestamp is formatted as a string, it's very difficult operating with it. I'd recommend casting it into a proper timestamp, using one of the "Interpretation functions" (search Help for this name) for example:
myTime = time#(Timestring, 'hh:mm:ss')
Once you convert your strings into proper time or timestamp fields, you can operate with them as with numbers:
1 day = 1
1 hour = 1/24
8:00 AM corresponds to 8/24 = 1/3
2:00 PM = 14:00, corresponds to 14/24 = 7/12
etc...
Hello Oleg,
I tried:
time#(timestring, 'hh:mm:ss') However, it did not convert the string to a number. It still returns times in the same format as before. Not sure if that's what you meant