Newbie question

  • Thread starter Thread starter John
  • Start date Start date
J

John

Can I create a query dialogue form which ,for exaple, asks for two dates and
returnes a predetermined set of data based on the two values entered.
Example Query......show me sales which occured between (date 1) AND (date
2). John
 
Can I create a query dialogue form which ,for exaple, asks for two dates and
returnes a predetermined set of data based on the two values entered.
Example Query......show me sales which occured between (date 1) AND (date
2). John

Is the query the end result, or is the query used as recordsource for
a report?
 
Can I create a query dialogue form which ,for exaple, asks for two dates and
returnes a predetermined set of data based on the two values entered.
Example Query......show me sales which occured between (date 1) AND (date
2). John

Yes; if your form is named frmCrit, with textboxes named txtFrom and
txtTo, you can use a query with a criterion on SalesDate such as
= [Forms]![frmCrit]![txtFrom] AND < DateAdd("d", 1, [Forms]![frmCrit]![txtTo])

The dateadd bit protects you from SalesDate records which contain a
time portion: #11/14/2005 20:45:30# is in fact later than November 14
(which assumes midnight at the start of the day).

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top