This topic is locked

How to get last week this week last month values of date

6/30/2007 6:31:11 PM
ASPRunnerPro General questions
L
live2 author

I am trying to create search by week.

I have a date field contains dates like 1/5/2007 & 5/7/2007

I want to build searchpage and create combo for the date field search and in combo i just want to put this week/last week/ last month etc. rather than having user put the date & then pass the value of that start date in the options at the back through code.
How do i bring in the last weeks start date or last 3rd weeks start date in combo so it should search as per the start and end date. And user only get to see the Last week/ this week / last month
thanks
ps :: Thanks admin for last answer. i am still trial mode. I intend to get it next week.

Sergey Kornilov admin 7/2/2007

You need to use date functions in SQL query to calculate the beginning of the week.
Here is the article that can help:

http://www.databasejournal.com/features/ms...cle.php/3650031