You are here: Re: problem in date comparison « MsSQL Server « IT news, forums, messages
Re: problem in date comparison

Posted by Dan Guzman on 06/26/07 11:52

> select order from ordertable
> where orderdate >= '06/20/2007' and orderdate < '06/21/2007'

I would expect this query to work if the orderdate column is a datetime data
type (although format 'yyyymmdd' is preferred since it is unambiguous). In
the case of char or varchar, string comparison rules are used instead so you
might not get the results you expect.

--
Hope this helps.

Dan Guzman
SQL Server MVP

<navneetkasulkar@gmail.com> wrote in message
news:1182854550.095525.236690@o11g2000prd.googlegroups.com...
>I have a problem in this query:
>
> select order from ordertable
> where orderdate >= '06/20/2007' and orderdate < '06/21/2007'
>
> this query do not return any record
> although there are records in the table matching the query
>
> please help me
>

 

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

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