I have a simple form to show a report and the records it shows are based off of the standard "due today", "5 days late", "10 days late" and "More than 15 days late"
Is my code correct for filtering the SQL? I recall having to surround the dates with # but will this suffice?
Thanks for the help, these forums have been a live saver!
Is my code correct for filtering the SQL? I recall having to surround the dates with # but will this suffice?
Code:
If intReportOption = 1 Then
LateDate = Date
Else: intReportOption = 2
LateDate = Date - 5
Else: intReportOption = 3
LateDate = Date - 10
Else: intReportOption = 4
LateDate = Date - 15
End If
If intReportOption = 1 Then
qry = qry & "AND ((TBL_Items.DueDate) = " & LateDate & ")) "
Else: intReportOption = 2
qry = qry & "AND ((TBL_Items.DueDate) Between " & DueDate & " And " & LateDate & "));"
Else: intReportOption = 3
qry = qry & "AND ((TBL_Items.DueDate) Between " & DueDate & " And " & LateDate & "));"
Else: intReportOption = 4
qry = qry & "AND ((TBL_Items.DueDate) <= " & LateDate & ")) "
Thanks for the help, these forums have been a live saver!