RE: parameter query for greater than date
- From: KARL DEWEY <KARLDEWEY@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 29 May 2008 12:36:29 -0700
Your orignal post said "I'd like a query to return results greater than sixwhen I enter ">DateAdd("ww",6,Date())" into both fields, it returns nothing.
weeks from whatever date I enter (or preferably the date I am running the
query)."
Your entry of >#04/14/2008# is not six weeks from 'date of entry' but 6
weeks ago, big difference.
If you use the second one I posted then it will be from the date you enter.
By the way if you use >#04/14/2008# then it will not pull a record dated
#04/14/2008 as it is not greater. You might want to use >=#04/14/2008# for
greater than OR equal.
--
KARL DEWEY
Build a little - Test a little
"tjb" wrote:
I actually have two date fields I was going to use this with in the same.
query and when I enter ">DateAdd("ww",6,Date())" into both fields, it returns
nothing.
When I enter the criteria manually as ">#4/17/2008#" it returns what I want.
Any ideas?
"KARL DEWEY" wrote:
It is used in date functions like 'd', 'm', or 'q' for day of month, monthWhat does the "ww" do?
of year, and quarter of year. "w" will give you day of week whereas 'ww' is
week of the year. In this case it is adding 6 weeks.
Did you place one of there in the criteria row of the query design view
grid? That is where you would use them.
--
KARL DEWEY
Build a little - Test a little
"tjb" wrote:
That didn't seem to work, could you explain what each piece of that code is
doing? What does the "ww" do?
"KARL DEWEY" wrote:
For 6 weeks from today use ---
>DateAdd("ww",6,Date())
For 6 weeks from date you enter use ---
>DateAdd("ww",6,CVDate([Enter start date for search]))
--
KARL DEWEY
Build a little - Test a little
"tjb" wrote:
I'd like a query to return results greater than six weeks from whatever date
I enter (or preferably the date I am running the query). Right now I'm
manually editing the query every time I run it to say ">#04/14/2008# but I
know Access has to have a way to automate this. Thanks!
- Follow-Ups:
- References:
- RE: parameter query for greater than date
- From: KARL DEWEY
- RE: parameter query for greater than date
- Prev by Date: RE: Order/identity/row number help needed
- Next by Date: Re: #Error
- Previous by thread: RE: parameter query for greater than date
- Next by thread: RE: parameter query for greater than date
- Index(es):
Relevant Pages
|
|