Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSSQL Real "time" datatype

Status
Not open for further replies.

jdemmi

MIS
Jun 6, 2001
1,106
US
I have a field in one of my reports that is storing "time". Not time like 12:00, but time like minutes. Example: 240.0 = 240 minutes. The MSSQL datatype of this field is "real".

My question is how can I display this field in my report such that the rounding will not "alter" the "time"

One example is if I have 20.0 in the DB the report is treating this as .33 hours (In the report I have to display hours. So I created a formula "timefield/60".)

Technically .33 does not equal 20 minutes. It's a little less. While this may not seem like a big issue, as months go by we would be "losing" lots of time (kind of like those fractions of pennies in Superman III)

This was kind of confusing to explain so let me know if you need more info

-- Jason
"It's Just Ones and Zeros
 
You could use the number formatted to the maximum number of decimals for your calculations, but for display purposes add the field again, rounding it to two decimals (suppressing the number used for calculations).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top