I am using DateDiff format like DATEDIFF(hour,Start,End) and it gave me the
result 12 hours.
Start:- 22 Sep 2006 09:30:00
End:- 22 Sep 2006 21:00:00
Is there any way it will return me 11.5 instead of 12 because it start from
9:30 and end at 21:00 so it must be 11.5 not 12 hours right...
Can any one guid me how I can solve this.
Thanks
No...it wouldn't really be 11.5. The first hour is 9 and the
second hour is 21. The difference between 9 and 21 is 12,
not 11.5. Your asking for the difference based on what
integer value is returned for the hour of the datetime value
you pass in.
Perhaps you want to find the difference in minutes and use
your own logic from there? What do you want to do if it's
9:01 and 21:00?
-Sue
On Wed, 27 Sep 2006 18:37:48 -0400, "Rogers"
<rogers@.hotmail.com> wrote:
>I am using DateDiff format like DATEDIFF(hour,Start,End) and it gave me the
>result 12 hours.
>Start:- 22 Sep 2006 09:30:00
>End:- 22 Sep 2006 21:00:00
>Is there any way it will return me 11.5 instead of 12 because it start from
>9:30 and end at 21:00 so it must be 11.5 not 12 hours right...
>Can any one guid me how I can solve this.
>Thanks
>
|||hi use this way so u will get the correct answer:
datediff(mi, from_time, to_time) / 60.00
ok got it
Rogers wrote:
> I am using DateDiff format like DATEDIFF(hour,Start,End) and it gave me the
> result 12 hours.
> Start:- 22 Sep 2006 09:30:00
> End:- 22 Sep 2006 21:00:00
> Is there any way it will return me 11.5 instead of 12 because it start from
> 9:30 and end at 21:00 so it must be 11.5 not 12 hours right...
> Can any one guid me how I can solve this.
> Thanks
|||Thanks
"samay" <sumi_r2@.rediffmail.com> wrote in message
news:1159408746.872297.16370@.h48g2000cwc.googlegro ups.com...
> hi use this way so u will get the correct answer:
> datediff(mi, from_time, to_time) / 60.00
> ok got it
> Rogers wrote:
>
|||hae it got worked? that date diff?
No comments:
Post a Comment