JohannIcon
Programmer
Dear all,
I have a field where the user can enter the number of days and then I have to search in the database to retreive the dates that are the same number of days or smaller than that number. What I am trying to do basically is calculate an expiry date, where the user enters the number of days remaining for a record to expire, for example 10 days, and I display all those records that will expire in 10 days or lesser. I tried to do it like this:-
if nodays <> "''" then
sqlBanner = sqlBanner & "WHERE banner.validtodate <= " & "'" & DateAdd("d", -nodays, Now()) & "'"
end if
But this is giving me errors.
What can I do?
Thanks for your help and time
I have a field where the user can enter the number of days and then I have to search in the database to retreive the dates that are the same number of days or smaller than that number. What I am trying to do basically is calculate an expiry date, where the user enters the number of days remaining for a record to expire, for example 10 days, and I display all those records that will expire in 10 days or lesser. I tried to do it like this:-
if nodays <> "''" then
sqlBanner = sqlBanner & "WHERE banner.validtodate <= " & "'" & DateAdd("d", -nodays, Now()) & "'"
end if
But this is giving me errors.
What can I do?
Thanks for your help and time