Hi. I have never used ASP before, but I have been given the task of creating a ASP Web interface to display the results of a database query. I need to have a form that allows the user to sort the results by date range. The database has the date and time stored in a 'datetime' data type field called "eventtime".
The first thing i need to do is create a variable, lets say "eventdate", that takes just the date out of the datetime field so i can compare it to the user input dates. However, i assume i need to somehow do this after i make the 'rs' connection to the database, but before i construct and execute the query.
I then need to have the form i create post the user date values into variables that i can also use in the query. Let's say "startdate" and "enddate". Should i use POST or GET to retrieve the the user input?
I then need to construct a query with all variables in it that searches for the correct date range. Something like:
I'm sure my syntax might be a little off, but please correct it as you see fit.
Also, a simple bounds checking procedure would be nice to make sure the user actually entered a date.
Any help with any and all of this would be greatly appreciated.
The first thing i need to do is create a variable, lets say "eventdate", that takes just the date out of the datetime field so i can compare it to the user input dates. However, i assume i need to somehow do this after i make the 'rs' connection to the database, but before i construct and execute the query.
I then need to have the form i create post the user date values into variables that i can also use in the query. Let's say "startdate" and "enddate". Should i use POST or GET to retrieve the the user input?
I then need to construct a query with all variables in it that searches for the correct date range. Something like:
Code:
"select * from table where" & eventdate & ">" & startdate & " and " & eventdate & "<" & enddate & ";"
I'm sure my syntax might be a little off, but please correct it as you see fit.
Also, a simple bounds checking procedure would be nice to make sure the user actually entered a date.
Any help with any and all of this would be greatly appreciated.