Parameter Query

A

Alexander

Dear all,

I have two field, "Begining Date" and "Ending Date"

I would like to make a paramater query to prompt the user to key in a
begining date and a ending date, and it will show all the data within the
two date range.

What should I do?

Thank You.

Cheers!








--
----------------------------------------------------------------------------
------------------------------------------------------------------
IMPORTANT NOTICE
Email from Leongkeat is confidential and private. If it is not intended for
you, please delete it immediately unread. The internet cannot guarantee that
this communication is free of viruses, interception or interference and
anyone who communicates with me by email is taken to accept the risks in so
doing. Without limitation, Leongkeat accept no liability whatsoever and
howsoever arising in connection with the use of this email.
 
G

Guest

Hi Alexander,
Change the YourTableName in the SQL below to the name of your table,
and possibly the name Date field to the name of the Date field in your table.

The user will be asked to enter a Begining Date and an Ending Date.
All the fields in the table will be output where the date field in your tabel is between the two parameters entered.

PARAMETERS [Begining Date] DateTime, [Ending Date] DateTime;
SELECT YourTableName.*, YourTableName.Date
FROM YourTableName
WHERE (((YourTableName.Date) Between [Begining Date] And [Ending Date]));
 
G

Guest

Alexander,
Sorry about the first answer, after re reading your question I realise that you have
two fields in your table called BeginingDate and Ending Date.
The correct SQL is below.

PARAMETERS [Enter Begining Date] DateTime, [Enter Ending Date] DateTime;
SELECT YourTable Name.*
FROM YourTableName
WHERE (((YourTableName.BeginingDate)>=[Enter Begining Date]) AND ((YourTableName.EndingDate)<=[Enter Ending Date]));


AlanInBradford said:
Hi Alexander,
Change the YourTableName in the SQL below to the name of your table,
and possibly the name Date field to the name of the Date field in your table.

The user will be asked to enter a Begining Date and an Ending Date.
All the fields in the table will be output where the date field in your tabel is between the two parameters entered.

PARAMETERS [Begining Date] DateTime, [Ending Date] DateTime;
SELECT YourTableName.*, YourTableName.Date
FROM YourTableName
WHERE (((YourTableName.Date) Between [Begining Date] And [Ending Date]));

Alexander said:
Dear all,

I have two field, "Begining Date" and "Ending Date"

I would like to make a paramater query to prompt the user to key in a
begining date and a ending date, and it will show all the data within the
two date range.

What should I do?

Thank You.

Cheers!








--
----------------------------------------------------------------------------
------------------------------------------------------------------
IMPORTANT NOTICE
Email from Leongkeat is confidential and private. If it is not intended for
you, please delete it immediately unread. The internet cannot guarantee that
this communication is free of viruses, interception or interference and
anyone who communicates with me by email is taken to accept the risks in so
doing. Without limitation, Leongkeat accept no liability whatsoever and
howsoever arising in connection with the use of this email.
 

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