By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,551 Members | 2,622 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,551 IT Pros & Developers. It's quick & easy.

Search orders based on user defined dates

P: 22

I have a database that tracks the withdraws and returns of shared tools.
It has been requested that the datablase is made able to show all orders based on a date range.

My orders only have one date, the order date. I have made a form that has two drop down boxes that reference a query which returns a list of all dates that have been entered.

So what I need this to do is when they click on the search button is look at all orders and filter based on the start date and end date and return the information in between the start and end date, inclusive of start and end date.

All that I have been able to get done is choose the start and end date, click on search and have every order returned.

I can't seem to get my code for 'on click' to reference the start and end date and filter based on them.


Sep 14 '07 #1
Share this Question
Share on Google+
1 Reply

Scott Price
Expert 100+
P: 1,384
Your SELECT query should look something like this:
Expand|Select|Wrap|Line Numbers
  1. SELECT OrderID, OrderEtc FROM tblOrder HAVING tblOrder.OrderDate BETWEEN "#" & Forms![FormName]![ComboBoxName1] & "#" AND "#" & Forms![FormName]![ComboBoxName2] & "#"
This is assuming that your bound column of the combo box is returning a date literal value, not a dateID integer value.

Sep 14 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.