#  Other Applications & Softwares  > Access Tables & Databases >  >  Access DB Novice - Trying to create a query that wiil pick data between 2 dates

## Ted Dennis

Sorry I am a complete novice to access but I am trying to build a query that will find data between 2 dates.  The table headers are EXPR1, EXPR2 through to EXPR 7 the date I want my query to look at is in EXPR 7.  Any help would be appreciated

Many Thanks

----------


## JosephP

in the criteria field in the query grid you can use between:

Between #01/01/2012# And #03/01/2012#

for instance

----------


## Ted Dennis

Thanks, the query is working however nothing has returned ? could this be because of the format of date and time in this column 14/04/2009 00:32:00 ?

----------


## JosephP

as long as they are actual dates and not text (and your date criteria are correct!) it oughta work fine. what's the actual criteria you've used?

----------


## Ted Dennis

I have just copien your expression #01/01/2012# And #03/01/2012#

thanks

----------


## romperstomper

Do you have dates between 1st and 3rd Jan 2012 in the table? (as you are in England, the dates should be treated as dd/mm/yyyy so that's not Jan-March 2012)

----------


## Ted Dennis

I have tried again using these dates 1st to 3rd  Jan ( these dates are in this field) and also 16/07/2012 to 18/07/2012 (these dates are also in the field.  On both ocassions nothing is returned ?

----------


## Ted Dennis

I have just realised the error in my ways I thought I had originally typed in the "Between" part of the criteria, which was now missing once typed back in this now, works

Thanks.

My next question is, how can aI desogn a form to replicate that query whcih enables me to input whatever dates I want ie between 15/07/2012 and 21/07/2012 or 13/07/2012 and 14/07/2012 ?

Thanks again

----------


## JosephP

add two textboxes to a form and change the query criteria to
Between [forms]![form1]![Text0] And [forms]![Form1]![Text2]

changing the form and textbox names to match your actual database.

----------


## James Donovan

It is really a great information. Thanks for sharing such a informative query..  :Smilie:

----------

