View previous topic :: View next topic |
Author |
Message |
misi Beginner
Joined: 14 Apr 2004 Posts: 13 Topics: 10
|
Posted: Wed Apr 21, 2004 11:48 am Post subject: how to find if last month has 30 or 31 days from the current |
|
|
I have a program which should generate monthly report. The report can be run on any day of the month. The SQl query should retrieve all records which has been inserted for the last 1 month from the current date. A timestamp field is present in the table. How do I write the query to retrieve the last 1 months data If i run the query on any day of the month. Last month can have 30 or 31 days or 28 or 29 days..So accordingly my query should calculate the start date and obviously the end date is the current date.
misi |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
|
|