ۥ-x@ -5jjjjjjjx   B4DrjCrystal Reports Technical Document Subject: Displaying time stored in date/time fields dBase,Paradox,Btrieve) Date: July 27, 1993 Versions: All Description: When using ObjectVision (OV) to define a Time field, OV will store these fields as a Numeric in Paradox, as a Num(mm, nn) in dBase and as a TIME in Btrieve. If the database used is Paradox or dBase the value is stored as a fraction of the number of seconds in one day. For example: If the user enters 1:20:03 in the Time field in OV, the value stored in dBase would be: 0.055590 (Number of seconds in 1:20:03 = (3600 * 1 hour)+(60 * 20 minutes)+(3 seconds)=4803 seconds 4803 seconds as a fraction of 1 day is: 4803 / (24 * 60 * 60) = 0.055590 days As a result, for Crystal Reports to display this value as 1:20:03, the following formulas are required. - @HOURS: which displays the hour value Truncate({@Time in True Time} / 3600) - @MINUTES: which displays the minute value Truncate (({TIMES.time1} - ({@hours} * 3600)) / 60) - @SECONDS: which displays the second value Truncate ({TIMES.time1} - ({@hours} * 3600) - ({@minutes} * 60)) - @TIME AS STRING: which uses the values from the 3 previous formulas to display 1:00:01 - @Time in True Time {time.time1} * 60 * 60 * 24 - @Military Time String ToText ({@hours}, 0) + ":" + ToText ({@minutes},0) + ":" + ToText ({@seconds}, 0) If OV is writing to a Btrieve file, using the above example, the Btrieve TIME field would contain 4803 and the formulas in TIME.RPT would be identical except for the following: - the formula @TIME IN TRUE TIME is not required and should be deleted - all other references to @TIME IN TRUE TIME should be changed to {ALIASNAME.timefield} Remarks: User defined functions are probably a better alternative if using 2.0 Professional. TIMEFLD.DOC !#0^pV^  #%3}CES?hj')V\rTV`0*0*0* 0*0*0*0* 0* 0B H HBTimes New Roman Symbol&Arial5Courier New 1Courier"h%heY{r#Displaying Time in Date/Time FieldsTechnical Support DocumentTimeAllan D. McMordie Gurdeep Birdi