Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Access Forms > Filtering on a ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 44630 of 46475
Post > Topic >>

Filtering on a series of Dates via a combo box

by =?Utf-8?B?QUpPTFNPTg==?= <AJOLSON@[EMAIL PROTECTED] > Aug 6, 2008 at 11:20 AM

I am trying to apply a filter to a series of dates.  

An Example is:
I want to filter on all records with dates that fall between Jul, 1,2008
and 
July, 7, 2008 (a seven day period) I am using a combo box to try and do
this. 
 

Here are the two codes I have used: 
Code #1
Me.Filter = "[ProductionDate] >= " & Format(Me.ComboFilterDate, 
"\#yyyy\-mm\-dd\#")
Me.Filter = "[ ProductionDate]- 6 <= " & Format(Me. ComboFilterDate, 
"\#yyyy\-mm\-dd\#")
Me.FilterOn = True

Code #2
I did try this too but to no avail
Me.Filter = "[ProductionDate] >= and [ProductionDate]-6<= " & 
Format(Me.ComboFilterDate, "\#yyyy\-mm\-dd\#")

Neither code works
In  Code #1 example of what is happening is the first line is working
great 
I get all Production dates that are the date selected and higher, 
However,  
when the second filter is applied it wipes out the first one and returns
all 
records that are 7 days after the selected date to the first date of 
production. Which is undesirable.

In Code#2 all I get is a syntax error
 (missing Operator ) in query expression  ‘[ProductionDate}>=and 
[ProductionDate]-7<= #2008-07-25#’

I figure the issue is placing an “and” qualifier in there somewhere
but 
can’t figure out where to put it.
So any help would be greatly appreciated.  Thanks
Andy
 




 5 Posts in Topic:
Filtering on a series of Dates via a combo box
=?Utf-8?B?QUpPTFNPTg==?=   2008-08-06 11:20:00 
Re: Filtering on a series of Dates via a combo box
"Douglas J. Steele&q  2008-08-06 14:34:28 
Re: Filtering on a series of Dates via a combo box
=?Utf-8?B?QUpPTFNPTg==?=   2008-08-06 13:43:01 
Re: Filtering on a series of Dates via a combo box
"Douglas J. Steele&q  2008-08-06 17:48:40 
Re: Filtering on a series of Dates via a combo box
Bob Quintal <rquintal@  2008-08-06 18:27:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 21:22:50 CST 2008.