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
 SQL Server Development (2000)
 select data according to date

Author  Topic 

anupalavila
Yak Posting Veteran

56 Posts

Posted - 2009-05-08 : 03:05:38
In my table I have 2 fields Id and Date

How can I select all the Ids from my table which are in a given date, with out using between

Thanks and Regards
Anu Palavila

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-05-08 : 03:12:31
What's wrong with using BETWEEN ?

You can use >= or > with <= or < instead of BETWEEN


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-08 : 14:11:21
seems like an interview question

WHERE YourDate >= DATEADD(dd,DATEDIFF(dd,0,Yourdatevalue),0)
AND YourDate< DATEADD(dd,DATEDIFF(dd,0,Yourdatevalue)+1,0)
Go to Top of Page
   

- Advertisement -