I would like to know how i can view the last 7 days off an database table without the problem i now have.
Last 7 days work fine except the last day off the month
example: it is day 30 + 1 but the month only has 30. When it the first day off the month it works fine because it counts correctly
(access will be mySQL in the near future) for now it is access
Listing:
var_datemax = Month(Now()) & "/" & Day(Now())+1 & "/" & Year(Now())
var_datemin = dateadd("d",-8,var_datemax)
Response.Write("<font class='fixed18b'>Nieuwsblad Transport newsletters : <br></font>"
Response.Write("<font class='fixed12r'>(From " & var_datemin & " till " & var_datemax & "<BR><br>"
'open recordset to show newsletters
set recordset = server.CreateObject("ADODB.recordset"
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Request.ServerVariables("APPL_PHYSICAL_PATH" & "upload.mdb"
strSQL = "SELECT * From ListFiles Where UploadDT Between #" & var_datemin & "# And #" & var_datemax & "# ORDER BY UPLOADDT DESC"
recordset.open strSQL,strConn,1,2
Do until recordset.EOF
response.Write("<a href='" & Recordset("DestFileName" & "' class='fixed12b'>" & Recordset("description" & "</a>"
response.Write " (" & recordset("UploadDT" & ""
response.Write("<BR>"
recordset.MoveNext
loop
recordset.Close
Response.Write("<a href='showall.asp' class='fixed10b'><br>Show all newsletter<br></a>"
Response.Write("<br><br>"
'Response.Write("<a href='db-file-to-disk.asp' class='fixed10b'>Upload a new newsletter<br></a>"
Response.Write("<br><br><br>"
Response.Write("</table>"
Response.Write("<br><br>"
Response.Write("<a href='login.asp' class='fixed10b'> Upload a new NTMAIL newsletter</a>"
Set Recordset = nothing
Last 7 days work fine except the last day off the month
example: it is day 30 + 1 but the month only has 30. When it the first day off the month it works fine because it counts correctly
(access will be mySQL in the near future) for now it is access
Listing:
var_datemax = Month(Now()) & "/" & Day(Now())+1 & "/" & Year(Now())
var_datemin = dateadd("d",-8,var_datemax)
Response.Write("<font class='fixed18b'>Nieuwsblad Transport newsletters : <br></font>"
Response.Write("<font class='fixed12r'>(From " & var_datemin & " till " & var_datemax & "<BR><br>"
'open recordset to show newsletters
set recordset = server.CreateObject("ADODB.recordset"
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Request.ServerVariables("APPL_PHYSICAL_PATH" & "upload.mdb"
strSQL = "SELECT * From ListFiles Where UploadDT Between #" & var_datemin & "# And #" & var_datemax & "# ORDER BY UPLOADDT DESC"
recordset.open strSQL,strConn,1,2
Do until recordset.EOF
response.Write("<a href='" & Recordset("DestFileName" & "' class='fixed12b'>" & Recordset("description" & "</a>"
response.Write " (" & recordset("UploadDT" & ""
response.Write("<BR>"
recordset.MoveNext
loop
recordset.Close
Response.Write("<a href='showall.asp' class='fixed10b'><br>Show all newsletter<br></a>"
Response.Write("<br><br>"
'Response.Write("<a href='db-file-to-disk.asp' class='fixed10b'>Upload a new newsletter<br></a>"
Response.Write("<br><br><br>"
Response.Write("</table>"
Response.Write("<br><br>"
Response.Write("<a href='login.asp' class='fixed10b'> Upload a new NTMAIL newsletter</a>"
Set Recordset = nothing