I started looking around to see why I was getting this error, when I happened to notice the date range I was inputting into the form fields for a Start Date was 02/01/99 and had an Ending Date of 02/30/99. Well once I saw the problem I had to come up with a way to handle the problem. What was the problem, well there is no date of 02/30/99 and SQL could not handle the expression and error out. The following is the code I used to correct the problem, the file is called process_selections.asp and handles lot's of other items passed to it from the form's page.
<% Date1 = Request("Start_Date") Date2 = Request("Stop_Date") DateCheck1 = IsDate(Date1) DateCheck2 = IsDate(Date2) If DateCheck1 = "False" Then Response.Redirect "bad_date.asp" End If If DateCheck2 = "False" Then Response.Redirect "bad_date.asp" End If %>
What this does is the following: