ADDDATE and checkbox = true

I have been asked to update this web app however I have never programmed in whatever this is written in, I think  it was copied over from C++
This statement returns all records and sorts by ID

Case "initial Date"
If strSrchType = "Equals" Then ( this is just a drop down select)
 sqlString = "SELECT * FROM TableName WHERE InitialDate=""" & strSrchFor & """ AND InitialDate >= " & strSrchFor & " ORDER BY ID, InitialDate"
End If

what I would like this statement to do is add 5 years to the initial date and return those records greater then today's date that do not have a disqualified checkbox = true

I would sooner not have to enter anything in the strSrchFor field , I would rather just select the search now button that is already there.

initial date is initialDate
disqualified check box is disqualified
name is ID
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I think you can just change your SQL statement.  Maybe something like this:

SELECT * FROM TableName WHERE disqualified=False AND DATEADD("yyyy",5,InitialDate)>Now() ORDER BY ID, InitialDate
Case "initial Date"
If strSrchType = "Equals" Then
 sqlString = "SELECT * FROM TableName WHERE disqualified=False AND DATEADD(""yyyy"",5,InitialDate)>Now() ORDER BY ID, InitialDate"
End If

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Wobbs_peiAuthor Commented:
I only had to change Date to Getdate
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.