Dates and times in Excel are stored as serial numbers of dates.
For example, 6:00 a.m. of today is stored as 39095.25: 39095 days + 1/4 day since the "reference date" used by Excel (31/Dec/1899).
So, I think you should calculate this number, and then give the cell the corresponding date (or time) format.
For a time, if the date is not of interest, you can use zero point something, e.g., 0.25 for 6:00 a.m. (1/4 of a day since midnight).
>hi all,
>i try to convert my table have some fields with numbers to excel sheet (convert number to hours and minuts, my report works, but excel sheet not any help
>
>
>.
>.
>.
>REPORT FORM rpt11 PREVIEW
>
>***select curbilldata
>
>gcDelimName = ALIAS( ) + '.xls'
>gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls')
>IF EMPTY(gcDelimFile)
> CANCEL
>ENDIF
>COPY TO (gcDelimFile) XL5
>
>
>FUNCTION Sec2Str(tnSeconds, llDays)
>
>LOCAL lcHH, lnTm, lcMM, lcSS, lcTime
>lnTm = tnSeconds
>IF llDays
> lcDD = TRANSFORM(INT(lnTm / 86400), "99") + " "
> lnTm = tnSeconds % 86400
> lcHH = TRANSFORM(INT(lnTm / 3600), "@L 9999")
>ELSE
> lcDD = ""
> lcHH = TRANSFORM(INT(lnTm / 3600), "@L 99999")
>ENDIF
>lnTm = lnTm % 3600
>lcMM = TRANSFORM(INT(lnTm / 60), "@L 99")
>lcSS = TRANSFORM(INT(lnTm % 60), "@L 99")
>lcTime = lcDD + lcHH + ":" + lcMM
>*lcTime = lcDD + lcHH + ":" + lcMM + ":" + lcSS
>RETURN lcTime
>
>thanks
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)