
September 11th, 2003, 04:14 PM
|
|
graphics monkey
|
|
Join Date: Sep 2001
Location: Georgia Tech, Atlanta, GA
Posts: 71
Time spent in forums: 3 h 52 m 21 sec
Reputation Power: 7
|
|
|
selecting only records from specific month (ASP & MSSQL)
I am having trouble coming up with the correct SELECT statement to use when I only want to select the records from a certain month. In this case, the current month. In my database all the date records are in this format:
MM/DD/YYYY HH:MMAM
I figured out what "this" month is by doing the following:
thisMonth = split(now, "/")
so thisMonth(0) will give me the numerical value for this month. In todays case, its 9.
I am then trying to select all records from my database that have their date field starting with the number 9. Here's what I'm trying:
"select hitDate from hits where hitDate like '%" & thismonth(0) & "/%/2003%' order by hitDate"
But this is not working. It keeps returning 0 results. Anyone know what i'm doing wrong, or better yet, a proper way to do what I'm trying to do?
__________________
Brian
|