How in a query can I turn a 32:15 hour to a 32.25 number
How in a query can I turn a 32:15 hour to a 32.25 number
What is the underlying data stored as? 32:15 is more than a day, so it normally wouldn't look that way.
However, assuming that it is a standard MS date/time field, stored in hours, without the year/month/day part, then multiply by 24 to get a decimal number of hours. the reason is because a Date/time field stores dates and +1 is one day (24 hours) later.
You might need to force/cast the type with Round( (your expression) , 2) or CDec(Your expression) or some similar method.
32:15 is 33 hours and 15 min. This comes from a table whick is updated by kronos and is a text field in the table.
Okay.
It's not elegant, but try this:
Code:IIF(instr(,Mytime,":")>0,round(int(left(MyTime,instr(Mytime,":")-1)) + (100*int(mid(MyTime,instr(Mytime,":")+1,2))/60),2),0)
So a number returned but it added 32:15 came out 57 and 37:30 came out 87?
Okay, remove the 100*
I was first trying to build the string then switched to creating the number; forgot to remove the multiplier.
It says its an invalid syntex dur to commas? IIF(instr(,[Total Hours],":")>0,round(int(left([Total Hours],instr([Total Hours],":")-1)) + (int(mid([Total Hours],instr([Total Hours],":")+1,2))/60),2),0)
remove the comma after the open paren in "IIF(instr(,[Total"