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)
 SEARCHING DATES

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-07-17 : 11:56:08
Foley writes "I am well aware that you dont normally deal with ASP questions, but this has very little ASP. What I am trying to do is create a search page in my application, which will look into my SQLServer 7 database for users registration between two months(e.g search for registration between January and February, January and March, etc). I will have two drop down list of months where I can search for data within these two list of months.

Can you help with a query to do this search. The name of the registartion date field in my database is register_date. So I want some thing like

SELECT * FROM USERS WHERE register_date between JANUARY and MARCH order by register_date

However since I will be search between not only January and March but between any one month and the other, I do not want to categorically put the months in the query but rather put it in a variable which will be retrieved from the form

Thanks
Foley"
   

- Advertisement -