passing input to a SQL query

  • Thread starter Thread starter brian
  • Start date Start date
B

brian

Is it possible to use a text box in a form to pass date
information to a SQL query? Here's what I'm doing.

Form1 has two fields - date1 and date2. Date1 is assigned
the value Now() and Date2 is assigned Now() +1. I run
this query daily to update a table with new info.

I would like to pass date1 and 2 into a SQL query so that
when I run the query daily, I don't have to enter the
dates each time.

Anyone have an idea?

your help is appreciated.
 
It is possible to pass info to a sql query. However, it
looks like you could build your sql using date functions,
and not need to pass anything from your form.
 
Well, if it is always today's date and tomorrow's date then I wouldn't even
bother to use a form. Just use the Date function (not the Now function).

Date returns the Date; Now returns the date and TIME. When you attempt to
search for a record with a certain date and it also has the time you will run
into problems.

Without knowing your sql, I can only guess that you need something like:

Between Date() and Date() + 1

as criteria somewhere in the query.
 
Back
Top