|
Posted by DonLi2006 on 09/19/07 00:07
ahe, I spoke a bit too soon, new prob.
data sets:
start stop
19:30 02:15 (next day morning)
26:15 (invalid hh:mm time range)
CASE WHEN (datediff(n,start,stop) < 0) THEN 0 END
above stmt not good, what now? got to go eat, could you help me to
think, oh, you may ask, may I eat for you as well? :) thanks a
billion...
On Sep 18, 10:58 am, DonLi2...@gmail.com wrote:
> Beautiful, thank you.
>
> On Sep 18, 9:43 am, "Pall Bjornsson" <pa...@kvos.is> wrote:
>
>
>
> > Hi !
>
> > What I can see via quick read are two errors or mistakes.
>
> > 1) Definition of a variable or result of type decimal(1), can store at the
> > most one total number of digits both to the left and to the right of the
> > decimal point, so you'll never get a result with anything more than a single
> > digit number, even if the result should be 10 or more, in which case you
> > should get an overflow error.
>
> > 2) The division by the integer number 60 forces the operation to be an
> > integer division, as you can easily see by executing this statement:
> > select datediff(n,'08:00','14:25')/60,
>
> > convert(decimal(1),datediff(n,'08:00','14:25')/60),
>
> > datediff(n,'08:00','14:25')/60.0,
>
> > convert(decimal(1),datediff(n,'08:00','14:25')/60.0)
>
> > Hope this helps,
>
> > Palli
>
> > <DonLi2...@gmail.com> wrote in message
>
> >news:1190084992.933315.305940@g4g2000hsf.googlegroups.com...
>
> > > Hi,
> > OP omitted
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
Navigation:
[Reply to this message]
|