on 2015 Apr 14 7:58 AM
Hi,
I have a field which is stored in numeric format for time.
The field can be 3 or 4 digits field.
I want to display this fields as the time field.
For example,
900 9:00 AM
1000 10:00 AM
1600 16:00 AM
Please reply.Thanks.
Request clarification before answering.
Hi Saurabh,
Try this:
numbervar x := {number_field};
numbervar fin_t := (x/100)*3600;
NumberVar Hours := Truncate (fin_t/3600);
NumberVar Minutes := Truncate (Remainder (fin_t,3600)/60);
NumberVar Seconds := Remainder (fin_t,60) ;
ctime(hours, minutes, seconds);
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saurabh,
Try the below formula
StringVar sMyTime := ToText({your_numeric_column}, 0, "");
IF Len(sMyTime) = 3 Then
cTime(sMyTime[1] & ":" & sMyTime[2 to 3] & " " & "AM"
else IF Len(sMyTime) = 4 Then
cTime(sMyTime[1 to 2] & ":" & sMyTime[3 to 4] & " " & "AM"
--Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, You can also use this formula to convert the time to a 24-hour format. Please replace the table name and field name with the appropriate values for your specific data.
Left(Replace(ToText({ORCT.DocTime}, 0), ",", ""), Length(ToText({ORCT.DocTime}, 0)) - 3) +':' + Right(ToText({ORCT.DocTime},0),2)
Original Value 14,33.00
Converted value 14:33
Thank you
Siwantha Matarage
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
11 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.