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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

decimal numbers don't show

Status
Not open for further replies.

srd

Technical User
Oct 16, 2001
14
PT
I have already asked a similiar question... but I just can't solve this... please help.

I have this script to change a record that as been imported as text, but is in fact a period of time in 0(h):00(min):00(secs), and I need it to change it to a "decimal time"... Had one that worked with 00:00 but now, because it was necessary to change it, the script doesn't work. It roundsup the numbers and I would need it to give me at 2 decimal numbers.

SELECT CDbl(Left([DUR CHAM],1)*60)+Mid([DUR CHAM],3,2)+(CLng(Right([DUR CHAM],2)/60)) AS DUR_CHAM_dec INTO chamadas_teste
FROM factura_20030601_20030631;

Many thanks... and sorry for this mess.

sIMAO d.
 
Try the following.

i.e.

SELECT CDbl(Left([DUR CHAM],1)*60.00)+Mid([DUR CHAM],3,2)+(CLng(Right([DUR CHAM],2)/60.00)) AS DUR_CHAM_dec INTO chamadas_teste
FROM factura_20030601_20030631;
 
it doesn't work... :-(
 
srd,

Are you using Microsoft SQL Server (which is what this forum is for)?

I don't recognize cDBL, MID, and cLNG as valid Transact-SQL syntax (I could be wrong though).

If you aren't using SQL Server, you might be having problems if what you are using doesn't recognize TSQL commands.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top