You are here: Re: Searching a datetime field by time « MsSQL Server « IT news, forums, messages
Re: Searching a datetime field by time

Posted by Andrew Chalk on 01/13/06 00:48

Thanks.
"Eric J. Holtman" <ejh@ericholtman.com> wrote in message
news:Xns9749B2BD466A7ejhericholtmamcom@216.168.3.30...
> "Andrew Chalk" <achalk@magnacartasoftware.com> wrote in
> news:Pgyxf.629$PL5.489@newssvr11.news.prodigy.com:
>
>> I have the time of an event stored on each record as a datetime
>> field.It includes the year,month,day, etc. Suppose my user wants to
>> search the table for all events over the lunch hour, say between11am
>> and 1pm. How do I construct the SELECT query to peek into each
>> datetime field and return only those records that satify the specified
>> time range?
>>
>> Many thanks.
>>
>>
>
>
> Scary. Really scary.
>
>
> select * from Events
> where datpart(hh,evt_time) between 11 and 13
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация