Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Newbie Question

Author  Topic 

GSql01
Starting Member

2 Posts

Posted - 2009-05-28 : 21:34:47
Hi,

Can you please tell me why this query does not return the dates expected? It has to be something basic but can't figure it out.

----------------------

SELECT CONVERT(CHAR(10),orders.DueDate,101)

FROM dbo.orders

WHERE CONVERT(CHAR(10),orders.DueDate,101) BETWEEN '01/01/2009' AND '05/01/2009'

-----------------------

It returns dates all over including 2002..., If I change one of the dates that it is in 2008, then I get nothing returned at all.

DueDate is a datetime, SQL Server 2000

Thank you.

GSql01
Starting Member

2 Posts

Posted - 2009-05-28 : 22:01:09
OK I figured it out...

----------------------

SELECT CONVERT(CHAR(10),orders.DueDate,101)

FROM dbo.orders

WHERE orders.DueDate BETWEEN '01/01/2009' AND '05/01/2009'

-----------------------
Go to Top of Page
   

- Advertisement -