use current date 2 find records between 2 dates

G

Guest

I cant figure out how to set up my Table on Access OR write formulas for this
to work; ...this is my problem:

I have 2 dates, StartDate and FinishDate. The dates are either 6 or 12
months apart. They can either be in two columns (eg "StartDate" 1/01/05 is 1
column and "FinishDate" 1/06/05 is another) or in one column as "DatesFrom"
(eg 1/01/05 - 1/06/05)

What I need to do is: In a seperate box somewhere, type in todays date or
month and press enter: Resulting in matches from my table to pop up,
displaying all those records that match the date I typed in that has that
particular date between its two dates.
Example: Type in 23/03/05 brings up "1/01/05 - 1/06/05" because its
But if I type in 15/07/05 it will not bring up "1/01/05 - 1/06/05" because
its after the date.

If anyone can help me or put me onto a website that will explain the process
of what I want to do, you can email me at (e-mail address removed)
 
P

PC Datasheet

You want all records where StartDate is less than or equal to the date you
enter and End date is greater than or equal to the date you enter. Put the
following expression in the criteria for StartDate:
<=Forms!MyFormName!MyTextBoxName
Put the following expression in the criteria for EndDate:
=Forms!MyFormName!MyTextBoxName

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
 
G

Guest

I really appreciate your help, but I either didnt put the formula in
correctly or I didnt put the correct formula in the right spot. My office
Assistant kittycat said there was an error in the expression i wrote. Here's
what I did:

In OBJECTS, QUERIES, I opened up my table which is called Table1 Query.
I went into DESIGN VIEW. In the CRITERIA row under the "Date Start" and
"Date Finish" columns I tried to type in my formulas and then on closing an
error came up. It wouldnt let me close/ press enter... the formula didnt
work.

Can you please make the formulas more specific? What information do you
need for me to complete this?

Sincerely
-Kit
 
J

John Vinson

In OBJECTS, QUERIES, I opened up my table which is called Table1 Query.
I went into DESIGN VIEW. In the CRITERIA row under the "Date Start" and
"Date Finish" columns I tried to type in my formulas and then on closing an
error came up. It wouldnt let me close/ press enter... the formula didnt
work.

Can you please make the formulas more specific? What information do you
need for me to complete this?

PMFJI but... did you use the sample guesses that PC Datasheet used as
examples, or did you use the actual name of your form and your
textbox? And is the Form open at the time you try to run the query? It
won't work unless it is.

If these ideas don't help please open your query in SQL view and post
the SQL text here, along with the text of the error message.

John W. Vinson[MVP]
 
G

Guest

John... hate to sound blonde, but when I get instructed to do something, a
brief step-by-step note to tell me what it is your trying to tell me to do
and where to find it would be appreciated...! Lucky I have my Office
Assistant Kittycat to help with those small dilemas! lol!!

Okay back to business... Here is the SQL thingy I need to post:
SELECT Table1.ID, Table1.Title, Table1.Name, Table1.Surname, Table1.Company,
Table1.[Address 1], Table1.[Address 2], Table1.Suburb, Table1.[12 m],
Table1.Postcode, Table1.Demographic, Table1.[6m], Table1.[Date Start],
Table1.[Date ending], Table1.State
FROM Table1;

....and the Office assistant states the following when the formula/expression
isnt correct:
The expression you entered has a function containing the wrong number of
arguments.

(sometimes he says: "...it contains invalid syntax" )

Any idea what I can do from here? ...Im willing to keep tryng.
Dont forget to tell me "where" to find the buttons or items I need to
press/use or what they mean... Im not 100% farmiliar with all of Access terms
yet.

Keen to keep trying
-Kit
 

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