Got this one, converted getdate() and it worked.
[quoted text, click to view] "Alejandro" <arkark2004@hotmail.com> wrote in message
news:uifzuPM3GHA.476@TK2MSFTNGP06.phx.gbl...
>I have the following query:
>
> Select convert(char(8), loginstartime, 108) as startime, convert(char(8),
> loginendtime, 108) as endtime from userlogin
>
> It returns two values:
>
> startime = 08:00:00
> endtime = 18:30:00
>
> Right now it is 10:40 am
>
> If I add a where clause I get no results when in fact I should still get
> this record, the clause is:
>
> Select convert(char(8), loginstartime, 108) as startime, convert(char(8),
> loginendtime, 108) as endtime from userlogin
> WHERE convert(char(8), loginstartime, 108) < getdate() and getdate () <
> convert(char(8), loginendtime, 108)
>
>
> 8:00 am is < than 10:40 am .. if I cut the sql here I DO get the results,
> but If I add the end date part of the SQL I get no results, when in fact
> 10:40:00 is < than 18:30:00
>
> what am I missing ? Should I also convert the getdate() function ? If so
> how ?
>
> A
>