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)
 Between 2 Dates!

Author  Topic 

jesus4u
Posting Yak Master

204 Posts

Posted - 2003-07-07 : 10:18:07
TableA that has 2 columns (StartDate, EndDate).
How do I return all records from TableA where today's date is between the StartDate and EndDate?

Thanks

jesus4u
Posting Yak Master

204 Posts

Posted - 2003-07-07 : 10:30:14
I think I got it!


(GETDATE() >= Announcements.AnnouncementStartDate) AND (GETDATE()
<= Announcements.AnnouncementEndDate)




Go to Top of Page

macka
Posting Yak Master

162 Posts

Posted - 2003-07-07 : 11:53:14
Is there any difference between the way the expression above and the expression below is evaluated ?

(Announcements.AnnouncementStartDate <= GETDATE())
AND (Announcements.AnnouncementEndDate >= GETDATE())

macka.



--
There are only 10 types of people in the world - Those who understand binary, and those who don't.

Edited by - macka on 07/07/2003 11:58:50
Go to Top of Page

jesus4u
Posting Yak Master

204 Posts

Posted - 2003-07-07 : 12:41:52
not sure but did you notice that you and I both have the same post count?

Go to Top of Page
   

- Advertisement -