Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys, Need some help...
I am trying to solve the following...
,Num(Mid(Time(WorkStart,'hh:mm'),4,2)) + Num(DateMinutes) as x2
where:
Time(WorkStart,'hh:mm') is equal to 07:00
DateMinutes is equal to 600
The result I am looking for is: 0+600 = 600 Instead I get 0.41666666666667
How do I work it around?
Thanks in advance,
Aldo.
I don't understand the question, but times are stored as fractions of a day. So 12 hours is stored as 0.5. 600 minutes is 0.41666666... days. So is your DateMinutes field actually an interval (also in fractions of a day) instead of an integer number of minutes?
In any case, if you want to add one to the other, they'll need to be the same sort of measurement, either fractions of a day or number of minutes or whatever.
=num(Timestamp(0.41666666666667) ) * 24 * 60
I am still checking it. I'll let you know.
Aldo.
Hi Nick, based on your suggestion, I used:
,Date(RangeSum(Peek(WorkDateSequence),Num(TimeStamp(DateMinutes))),'DD/MM/YYYY hh:mm') as WorkDateSequence
Maybe you don't need to use TimeStamp function if your DateMinutes field has Date/TimeStamp type. I used the TimeStamp function just to convert number to timestamp for reproducing your example.
Yeap! you are right, Thanks.