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 Id for a date

Author  Topic 

anupalavila
Yak Posting Veteran

56 Posts

Posted - 2008-12-02 : 04:23:53
I have a table with 3 fields Id,datafrom and dateTo how can I know the Id of a given date which falls between datefrom and dateTo for the date

Id datefrom dateTo
1 2008-11-1 00:00:00.000 2008-11-3 00:00:00.000
2 2008-11-5 00:00:00.000 2008-11-7 00:00:00.000
3 2008-11-9 00:00:00.000 2008-11-11 00:00:00.000

if I enter date as 2008-11-10 00:00:00.000 I could get the Id 3

Thanks and Regards
Anu Palavila

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-12-02 : 04:25:18

Where @date between datefrom and dateTo

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

anupalavila
Yak Posting Veteran

56 Posts

Posted - 2008-12-02 : 04:50:56
Thanks for your valuable replay

Thanks and Regards
Anu Palavila
Go to Top of Page
   

- Advertisement -