Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I need to convert a fraction into time format.
For example, I have 1.75 (1hr 45mins) and need to convert it to 1:45
or
2.25 should be "2:15" (which is 2 hours 15 minutes).
Many thanks in advance,
Matt
Hi,
Try this,
= Time(([Fraction field]/24), 'hh:mm')
for example, = Time((1.75/24),'hh:mm') gives 01:45
Hope it helps.
Hi,
Try this,
= Time(([Fraction field]/24), 'hh:mm')
for example, = Time((1.75/24),'hh:mm') gives 01:45
Hope it helps.
Hi both, thank you but that doesnt seem to work.
Just to add: I need to do this for all the values in a specific colum in my raw data, so I should probably build this into the script and call it "as Converted_Time,"... do you know how I can do this within the script?
Many thanks,
Matt
Hi,
Try this,
Load * , Time([FractionField]/24,'hh:mm') as Converted_Time from [Tablename];
For example,
temp:
load * inline
[
fraction
1.75
2.25
];
Load Time((fraction/24),'hh:mm') as Convert_time Resident temp;
Hope it helps.
Hi,
Check with this
Load
Time#(Floor(FractionField)&':'&(Frac(FractionField)*60),'h:m') AS Converted_Time
.
.
FROM ....
Celambarasan