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)
 Fuzzy selection of dates

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-15 : 00:33:59
Tiffany writes "Say I have a table listing several events. The table columns are: EventName and EventDate. I would like to select the events that occur on the current date (ordered by the EventName), but failing that, would like to select the most recent previous event (again ordered by the EventName).

So if I had the following table:

EventDate EventName
12/03/01 Foo
12/04/01 Foob
12/04/01 Fooc
12/07/01 Food


And today's date was 12/06/01, EventName's Foob and Fooc would be returned.
Thanks!
tif



"
   

- Advertisement -