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)
 SQL Query between two dates

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-04-11 : 07:21:31
John Wayne writes "I have a table with User field, a StartDate field, and a EndDate Field. (Ex. User = John, StartDate = 04/01/2003, EndDate = 04/08/2003)
I want to use ASP to display the current days EndUser. How do I query the DB to return the EndUser data between those two date fields. (Ex. if the date is 04/03/2003, the ASP page should show Enduser=John).

Thanks"

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-04-11 : 07:34:14
Hi John:

DECLARE @TheDate DATETIME
SET @TheDate = '04/03/2003'
SELECT User FROM UserTable WHERE @TheDate BETWEEN StartDate AND EndDate

OS

Go to Top of Page
   

- Advertisement -