Are parameters never interpeted?

  • Thread starter Thread starter Will Pittenger
  • Start date Start date
W

Will Pittenger

I have a report with a date parameter. Regardless of what I put in, I get
the exact same string in my report. I like the idea of allowing users to
enter "11/2/04" or "11-2-2004". However, I would prefer that Access
converted the date to the regional settings in Windows before printing the
report. I did give the text box a "Short Date" format. I am using Access
2002.
 
If Access is just reproducing whatever you typed instead of displaying the
value correctly in the report, it may not be understanding the value as a
date.

If the report is based on a parameter query, make sure you declare the
parameter in the query. For example, if the parameter is named [Enter a
date], then choose Parameters on the Query menu. Access opens a dialog.
Enter:
[Enter a date] Date/Time
If the parameter reads the value from a form, set the Format of the text box
on the form, and also declare it in the query. The entry in the Parameters
dialog will be something like this:
[Forms].[Form1].[Text1] Date/Time

More information:
Calculated fields misinterpreted
at:
http://members.iinet.net.au/~allenbrowne/ser-45.html
 
The date is only in the report. It has no meaning outside the report. As
such, it is not in a query (the report accesses the table directly) or a
form (which could care less about the date).
----------
Will Pittenger
E-Mail: mailto:[email protected]
All mail filtered by Qurb (www.qurb.com)
Allen Browne said:
If Access is just reproducing whatever you typed instead of displaying the
value correctly in the report, it may not be understanding the value as a
date.

If the report is based on a parameter query, make sure you declare the
parameter in the query. For example, if the parameter is named [Enter a
date], then choose Parameters on the Query menu. Access opens a dialog.
Enter:
[Enter a date] Date/Time
If the parameter reads the value from a form, set the Format of the text
box on the form, and also declare it in the query. The entry in the
Parameters dialog will be something like this:
[Forms].[Form1].[Text1] Date/Time

More information:
Calculated fields misinterpreted
at:
http://members.iinet.net.au/~allenbrowne/ser-45.html
 
In that case, I see no way to define the data type, so whatever you type is
what you get.

JET is not good at understanding data types at the best of times.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Will Pittenger said:
The date is only in the report. It has no meaning outside the report. As
such, it is not in a query (the report accesses the table directly) or a
form (which could care less about the date).
----------
Will Pittenger
E-Mail: mailto:[email protected]
All mail filtered by Qurb (www.qurb.com)
Allen Browne said:
If Access is just reproducing whatever you typed instead of displaying
the value correctly in the report, it may not be understanding the value
as a date.

If the report is based on a parameter query, make sure you declare the
parameter in the query. For example, if the parameter is named [Enter a
date], then choose Parameters on the Query menu. Access opens a dialog.
Enter:
[Enter a date] Date/Time
If the parameter reads the value from a form, set the Format of the text
box on the form, and also declare it in the query. The entry in the
Parameters dialog will be something like this:
[Forms].[Form1].[Text1] Date/Time

More information:
Calculated fields misinterpreted
at:
http://members.iinet.net.au/~allenbrowne/ser-45.html


Will Pittenger said:
I have a report with a date parameter. Regardless of what I put in, I
get the exact same string in my report. I like the idea of allowing
users to enter "11/2/04" or "11-2-2004". However, I would prefer that
Access converted the date to the regional settings in Windows before
printing the report. I did give the text box a "Short Date" format. I
am using Access 2002.
 
If your only asking for a date to be printed on the report you can use this
as the control source for a text box:

=Format(CDate([Enter Date]),"Short Date")





Will Pittenger said:
The date is only in the report. It has no meaning outside the report. As
such, it is not in a query (the report accesses the table directly) or a
form (which could care less about the date).
----------
Will Pittenger
E-Mail: mailto:[email protected]
All mail filtered by Qurb (www.qurb.com)
Allen Browne said:
If Access is just reproducing whatever you typed instead of displaying the
value correctly in the report, it may not be understanding the value as a
date.

If the report is based on a parameter query, make sure you declare the
parameter in the query. For example, if the parameter is named [Enter a
date], then choose Parameters on the Query menu. Access opens a dialog.
Enter:
[Enter a date] Date/Time
If the parameter reads the value from a form, set the Format of the text
box on the form, and also declare it in the query. The entry in the
Parameters dialog will be something like this:
[Forms].[Form1].[Text1] Date/Time

More information:
Calculated fields misinterpreted
at:
http://members.iinet.net.au/~allenbrowne/ser-45.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Will Pittenger said:
I have a report with a date parameter. Regardless of what I put in, I get
the exact same string in my report. I like the idea of allowing users to
enter "11/2/04" or "11-2-2004". However, I would prefer that Access
converted the date to the regional settings in Windows before printing the
report. I did give the text box a "Short Date" format. I am using Access
2002.
 
It will accept varied formats and not just my regional settings?
----------
Will Pittenger
E-Mail: mailto:[email protected]
All mail filtered by Qurb (www.qurb.com)
LGC said:
If your only asking for a date to be printed on the report you can use
this
as the control source for a text box:

=Format(CDate([Enter Date]),"Short Date")





Will Pittenger said:
The date is only in the report. It has no meaning outside the report.
As
such, it is not in a query (the report accesses the table directly) or a
form (which could care less about the date).
----------
Will Pittenger
E-Mail: mailto:[email protected]
All mail filtered by Qurb (www.qurb.com)
Allen Browne said:
If Access is just reproducing whatever you typed instead of displaying the
value correctly in the report, it may not be understanding the value as a
date.

If the report is based on a parameter query, make sure you declare the
parameter in the query. For example, if the parameter is named [Enter a
date], then choose Parameters on the Query menu. Access opens a dialog.
Enter:
[Enter a date] Date/Time
If the parameter reads the value from a form, set the Format of the
text
box on the form, and also declare it in the query. The entry in the
Parameters dialog will be something like this:
[Forms].[Form1].[Text1] Date/Time

More information:
Calculated fields misinterpreted
at:
http://members.iinet.net.au/~allenbrowne/ser-45.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a report with a date parameter. Regardless of what I put in, I get
the exact same string in my report. I like the idea of allowing users to
enter "11/2/04" or "11-2-2004". However, I would prefer that Access
converted the date to the regional settings in Windows before printing the
report. I did give the text box a "Short Date" format. I am using Access
2002.
 
The CDate function will convert the entered text, if possible, into the date
data type, which is then formatted as a short date.

Examples:

Enter: Results in:

9/15/04 9/15/2004
9-15-04 9/15/2004
2004 9 15 9/15/2004
9,15,2004 9/15/2004


A non-date entry will result in an error. The function will interpret the
entry with the regional settings (5/6/04 is May 6th, not June 5th), however
it will accept any valid delimiter.



Will Pittenger said:
It will accept varied formats and not just my regional settings?
----------
Will Pittenger
E-Mail: mailto:[email protected]
All mail filtered by Qurb (www.qurb.com)
LGC said:
If your only asking for a date to be printed on the report you can use
this
as the control source for a text box:

=Format(CDate([Enter Date]),"Short Date")





Will Pittenger said:
The date is only in the report. It has no meaning outside the report.
As
such, it is not in a query (the report accesses the table directly) or a
form (which could care less about the date).
----------
Will Pittenger
E-Mail: mailto:[email protected]
All mail filtered by Qurb (www.qurb.com)
If Access is just reproducing whatever you typed instead of
displaying
the
value correctly in the report, it may not be understanding the value
as
a
date.

If the report is based on a parameter query, make sure you declare the
parameter in the query. For example, if the parameter is named [Enter a
date], then choose Parameters on the Query menu. Access opens a dialog.
Enter:
[Enter a date] Date/Time
If the parameter reads the value from a form, set the Format of the
text
box on the form, and also declare it in the query. The entry in the
Parameters dialog will be something like this:
[Forms].[Form1].[Text1] Date/Time

More information:
Calculated fields misinterpreted
at:
http://members.iinet.net.au/~allenbrowne/ser-45.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a report with a date parameter. Regardless of what I put in,
I
get
the exact same string in my report. I like the idea of allowing
users
to
enter "11/2/04" or "11-2-2004". However, I would prefer that Access
converted the date to the regional settings in Windows before
printing
the
report. I did give the text box a "Short Date" format. I am using Access
2002.
 
Its working. Thanks.
----------
Will Pittenger
E-Mail: mailto:[email protected]
All mail filtered by Qurb (www.qurb.com)
LGC said:
The CDate function will convert the entered text, if possible, into the
date
data type, which is then formatted as a short date.

Examples:

Enter: Results in:

9/15/04 9/15/2004
9-15-04 9/15/2004
2004 9 15 9/15/2004
9,15,2004 9/15/2004


A non-date entry will result in an error. The function will interpret the
entry with the regional settings (5/6/04 is May 6th, not June 5th),
however
it will accept any valid delimiter.



Will Pittenger said:
It will accept varied formats and not just my regional settings?
----------
Will Pittenger
E-Mail: mailto:[email protected]
All mail filtered by Qurb (www.qurb.com)
LGC said:
If your only asking for a date to be printed on the report you can use
this
as the control source for a text box:

=Format(CDate([Enter Date]),"Short Date")





The date is only in the report. It has no meaning outside the report.
As
such, it is not in a query (the report accesses the table directly) or a
form (which could care less about the date).
----------
Will Pittenger
E-Mail: mailto:[email protected]
All mail filtered by Qurb (www.qurb.com)
If Access is just reproducing whatever you typed instead of displaying
the
value correctly in the report, it may not be understanding the value as
a
date.

If the report is based on a parameter query, make sure you declare the
parameter in the query. For example, if the parameter is named
[Enter a
date], then choose Parameters on the Query menu. Access opens a dialog.
Enter:
[Enter a date] Date/Time
If the parameter reads the value from a form, set the Format of the
text
box on the form, and also declare it in the query. The entry in the
Parameters dialog will be something like this:
[Forms].[Form1].[Text1] Date/Time

More information:
Calculated fields misinterpreted
at:
http://members.iinet.net.au/~allenbrowne/ser-45.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a report with a date parameter. Regardless of what I put in, I
get
the exact same string in my report. I like the idea of allowing users
to
enter "11/2/04" or "11-2-2004". However, I would prefer that Access
converted the date to the regional settings in Windows before printing
the
report. I did give the text box a "Short Date" format. I am using
Access
2002.
 
Back
Top