Help with Date Parameter

G

Guest

I have a Select Query where I want the user to be prompted to input the
specific date for records. The label is called "Business Date" and is on the
form "Daily Input Form". In the query design view, under Query =>
Parameters, I typed "Business Date" in the left column and selected
"Date/Time" in the right column.

When I run the query, records for all dates are displayed instead of just
the date in the prompt.

HELP! I am a beginner / novice, and tried looking for the answer in this
discussion group & Access Help. I'm sorry if this is a stupid question.
 
G

Guest

A new posting is never stupid, if you've searched this forum and can't find
the results you need. Posting is a good way to help yourself and others!

Best wishes
 
F

fredg

I have a Select Query where I want the user to be prompted to input the
specific date for records. The label is called "Business Date" and is on the
form "Daily Input Form". In the query design view, under Query =>
Parameters, I typed "Business Date" in the left column and selected
"Date/Time" in the right column.

When I run the query, records for all dates are displayed instead of just
the date in the prompt.

HELP! I am a beginner / novice, and tried looking for the answer in this
discussion group & Access Help. I'm sorry if this is a stupid question.

You only want records on the one date entered?

You need to set the query criteria to:
[Forms]![Daily Input Form]![Business Date]

Because your form and field names contain a space, you MUST enclose
those names within brackets.

Note: using spaces in Form and Field names is not a good idea.
Daily_Import_Form is just as easy to read, yet Access considers it as
one word. Brackets will not be necessary (but are still good
programming practice).

Next ....
In the Query Parameter dialog box, write:
[Forms]![Daily Input Form]![Business Date]
and select DateTime in the datatype box.
If you have additional criteria, you must include them, as above.

Include the brackets.
 
G

Guest

So my SQL view appears as follows:
PARAMETERS [Forms]![Daily Input Form]![Business Date] DateTime;
SELECT .........

However, the value for all the other values are showing 0 instead of the
actual value. For example, there is a field called "FTE" with a value of 3
I have a Select Query where I want the user to be prompted to input the
specific date for records. The label is called "Business Date" and is on the
form "Daily Input Form". In the query design view, under Query =>
Parameters, I typed "Business Date" in the left column and selected
"Date/Time" in the right column.

When I run the query, records for all dates are displayed instead of just
the date in the prompt.

HELP! I am a beginner / novice, and tried looking for the answer in this
discussion group & Access Help. I'm sorry if this is a stupid question.

You only want records on the one date entered?

You need to set the query criteria to:
[Forms]![Daily Input Form]![Business Date]

Because your form and field names contain a space, you MUST enclose
those names within brackets.

Note: using spaces in Form and Field names is not a good idea.
Daily_Import_Form is just as easy to read, yet Access considers it as
one word. Brackets will not be necessary (but are still good
programming practice).

Next ....
In the Query Parameter dialog box, write:
[Forms]![Daily Input Form]![Business Date]
and select DateTime in the datatype box.
If you have additional criteria, you must include them, as above.

Include the brackets.
 
J

John Spencer

DId you put the parameter prompt under the field you wish to apply the
criteria to?

Field: SomeDateField
Criteria: [Forms]![Daily Input Form]![Business Date]



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

So my SQL view appears as follows:
PARAMETERS [Forms]![Daily Input Form]![Business Date] DateTime;
SELECT .........

However, the value for all the other values are showing 0 instead of the
actual value. For example, there is a field called "FTE" with a value of 3
I have a Select Query where I want the user to be prompted to input the
specific date for records. The label is called "Business Date" and is on the
form "Daily Input Form". In the query design view, under Query =>
Parameters, I typed "Business Date" in the left column and selected
"Date/Time" in the right column.

When I run the query, records for all dates are displayed instead of just
the date in the prompt.

HELP! I am a beginner / novice, and tried looking for the answer in this
discussion group & Access Help. I'm sorry if this is a stupid question.
You only want records on the one date entered?

You need to set the query criteria to:
[Forms]![Daily Input Form]![Business Date]

Because your form and field names contain a space, you MUST enclose
those names within brackets.

Note: using spaces in Form and Field names is not a good idea.
Daily_Import_Form is just as easy to read, yet Access considers it as
one word. Brackets will not be necessary (but are still good
programming practice).

Next ....
In the Query Parameter dialog box, write:
[Forms]![Daily Input Form]![Business Date]
and select DateTime in the datatype box.
If you have additional criteria, you must include them, as above.

Include the brackets.
 
G

Guest

Yes - I actually deleted the data in the table and input again. This time it
worked.

Another question - when the parameter window pops up - is there a way to
display text other than "[Forms]![Daily Input Form]![Business Date]" such as
"Enter Business Date of Report" ?

Thanks!

John Spencer said:
DId you put the parameter prompt under the field you wish to apply the
criteria to?

Field: SomeDateField
Criteria: [Forms]![Daily Input Form]![Business Date]



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

So my SQL view appears as follows:
PARAMETERS [Forms]![Daily Input Form]![Business Date] DateTime;
SELECT .........

However, the value for all the other values are showing 0 instead of the
actual value. For example, there is a field called "FTE" with a value of 3
On Wed, 31 Oct 2007 11:13:00 -0700, Ben wrote:

I have a Select Query where I want the user to be prompted to input the
specific date for records. The label is called "Business Date" and is on the
form "Daily Input Form". In the query design view, under Query =>
Parameters, I typed "Business Date" in the left column and selected
"Date/Time" in the right column.

When I run the query, records for all dates are displayed instead of just
the date in the prompt.

HELP! I am a beginner / novice, and tried looking for the answer in this
discussion group & Access Help. I'm sorry if this is a stupid question.
You only want records on the one date entered?

You need to set the query criteria to:
[Forms]![Daily Input Form]![Business Date]

Because your form and field names contain a space, you MUST enclose
those names within brackets.

Note: using spaces in Form and Field names is not a good idea.
Daily_Import_Form is just as easy to read, yet Access considers it as
one word. Brackets will not be necessary (but are still good
programming practice).

Next ....
In the Query Parameter dialog box, write:
[Forms]![Daily Input Form]![Business Date]
and select DateTime in the datatype box.
If you have additional criteria, you must include them, as above.

Include the brackets.
 
F

fredg

Yes - I actually deleted the data in the table and input again. This time it
worked.

Another question - when the parameter window pops up - is there a way to
display text other than "[Forms]![Daily Input Form]![Business Date]" such as
"Enter Business Date of Report" ?

Thanks!

John Spencer said:
DId you put the parameter prompt under the field you wish to apply the
criteria to?

Field: SomeDateField
Criteria: [Forms]![Daily Input Form]![Business Date]

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
So my SQL view appears as follows:
PARAMETERS [Forms]![Daily Input Form]![Business Date] DateTime;
SELECT .........

However, the value for all the other values are showing 0 instead of the
actual value. For example, there is a field called "FTE" with a value of 3
on X date. When I input X in the parameter popup, the results are displayed
with a '0' instead of a '3'.

:

On Wed, 31 Oct 2007 11:13:00 -0700, Ben wrote:

I have a Select Query where I want the user to be prompted to input the
specific date for records. The label is called "Business Date" and is on the
form "Daily Input Form". In the query design view, under Query =>
Parameters, I typed "Business Date" in the left column and selected
"Date/Time" in the right column.

When I run the query, records for all dates are displayed instead of just
the date in the prompt.

HELP! I am a beginner / novice, and tried looking for the answer in this
discussion group & Access Help. I'm sorry if this is a stupid question.
You only want records on the one date entered?

You need to set the query criteria to:
[Forms]![Daily Input Form]![Business Date]

Because your form and field names contain a space, you MUST enclose
those names within brackets.

Note: using spaces in Form and Field names is not a good idea.
Daily_Import_Form is just as easy to read, yet Access considers it as
one word. Brackets will not be necessary (but are still good
programming practice).

Next ....
In the Query Parameter dialog box, write:
[Forms]![Daily Input Form]![Business Date]
and select DateTime in the datatype box.
If you have additional criteria, you must include them, as above.

Include the brackets.

Where did you get [Forms]![Daily Input Form]![Business Date] from?


Aren't you using a control on a form to enter the date parameter in?
That's what [Forms]![Daily Input Form]![Business Date] is looking for.
A control named [Business Date] on the form named [Daily Input Form].
If you use a form you will not be prompted at all.

If you're not actually using a form to enter the parameter in, and you
wish to be prompted for the date, change the query criteria (and the
query parameter dialog as well) to:
[Enter Date]
 

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