all groups > sql server programming > october 2004 >
You're in the

sql server programming

group:

Operantor / Divide


Operantor / Divide Jesus Cardenas
10/6/2004 10:56:07 PM
sql server programming: Hi Group!

I've two fields of type datetime and I want know how to calculate difference
in fraccion of hours,

if I execute this

select datediff(mi, convert(datetime,'2004-09-14 11:30:15.000'),
convert(datetime,'2004-09-14 12:00:57.000') )

the result is 30, but if I execute this

select datediff(mi, convert(datetime,'2004-09-14 11:30:15.000'),
convert(datetime,'2004-09-14 12:00:57.000') ) /60

the result is 0 and should be 0.5 hrs.

What's wrong with my code?

How can I get the fraction of hours ?

Re: Operantor / Divide nib
10/6/2004 11:01:07 PM


[quoted text, click to view]

Change 60 to 60.0.

Re: Operantor / Divide Jesus Cardenas
10/6/2004 11:07:20 PM
Hey!!! Thanks for your help!

Regards


[quoted text, click to view]

AddThis Social Bookmark Button