date quieries

S

Shirley

I have a parameter querie set up to ask for dates between beginning and
endding date. "7/1/2008 through 7/31/2008" and when you enter those dates,
wyou get all entries including dates with 2009 or 2007 years. how do I set
it to just use the current year.
 
M

Michel Walsh

It greatly depends on the DATA TYPE you set, in the table design, for the
date field you use. If you use a DateTime data type for it, then, in your
query, try #7/1/2008# and #7/31/2008#, note the # rather than the double
quote.

Also note that if you have TIME in addition to the date, in the fields,
then, #t/31/2008 06:00:00# occurs later than the limit on the interval you
specified. So, in that case, it may be preferable to use:
= #7/1/2008#


and


< #8/1/2008#


(note the strict inequality for the last expression, < , not <= )


as criteria, instead of BETWEEN.


Hoping it may help,
Vanderghast, Access MVP
 
R

raskew via AccessMonster.com

Try "between "7/1/2008 and 7/31/2008"

If that doesn't do the job, please post back with your query SQL

HTH - Bob
 

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

Top