This sql outputs an activity table (from an Access database - ASP classic)
I am now trying to filter the output 'per month'
- for example, to display only the records of the month of June (=> not working)
Do While Not rs.EOF and month (rs ("ActDate")) = month (cdate ("01/06/2020"))
Do While Not rs.EOF and month (rs ("ActDate")) = 6 (=> not working either)
(This test does work
response.write month (cdate ("01/06/2020")) & "<BR>"
if month (cdate ("01/06/2020")) = 6 then
response.write ("Correct!") & "<BR>"
end if)
- for example, only records 'older' than the month of May => does work !!!
Do While Not rs.EOF and month (rs ("ActDate"))> month (cdate ("01/05/2020"))
but only records 'younger' than the month of July (is not working)
Do While Not rs.EOF and month (rs ("ActDate")) <month (cdate ("01/07/2020"))
(My 'alternative' combination of 'older' and 'younger' doesn't work either)
Thanks for tips to filter 'per month'.
Code:
sql = "SELECT * FROM Activity ORDER BY Actdate DESC"
Do while Not rs.EOF
...
rs.moveNext
Loop
I am now trying to filter the output 'per month'
- for example, to display only the records of the month of June (=> not working)
Do While Not rs.EOF and month (rs ("ActDate")) = month (cdate ("01/06/2020"))
Do While Not rs.EOF and month (rs ("ActDate")) = 6 (=> not working either)
(This test does work
response.write month (cdate ("01/06/2020")) & "<BR>"
if month (cdate ("01/06/2020")) = 6 then
response.write ("Correct!") & "<BR>"
end if)
- for example, only records 'older' than the month of May => does work !!!
Do While Not rs.EOF and month (rs ("ActDate"))> month (cdate ("01/05/2020"))
but only records 'younger' than the month of July (is not working)
Do While Not rs.EOF and month (rs ("ActDate")) <month (cdate ("01/07/2020"))
(My 'alternative' combination of 'older' and 'younger' doesn't work either)
Thanks for tips to filter 'per month'.