Date in the query is always short date

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

I want to capture the LONG date from a query, so I create a parameter for the
date (mm ddd yy) . In its properties, it's format is long date, BUT it always
shows up the short date. WHY?
 
Dates are stored as decimal number counting days from 12/31/1899 midnight
with time as the decimal fraction of a day.

Formats are just different ways to display the information. So you got to
set the format. In design view of the query click the field of the grid that
has the datetime field, right click, scroll down and select Properties.
Click 'Format' and then in the pull down select 'Long Date'.
 
I want to capture the LONG date from a query, so I create a parameter for the
date (mm ddd yy) . In its properties, it's format is long date, BUT it always
shows up the short date. WHY?

Because Short Date, Long Date, and all the innumerable other date formats are
*just formats* - display settings.

The actual date is stored as a Double Float number - a count of days and
fractions of a day (times) since midnight, December 30, 1899. The format is
not part of the date, and a field (or a form or report textbox) can be
formatted any way you like to display the date.
 
Thank you both of you.

Karl, I did do exactly the same thing as you showed to format the long date
in the Query. I also go to the Report and at the date's text field, I format
long date also. But it still just show up the short date. BTW, this field
date is NOT in the database's table, I just capture it from the user's input
and want to display it as Long date. Pls advice. Thx.
 
BTW, this field date is NOT in the database's table, I just capture it from
the user's input
If it is not from a table then where is it from?

If it is text instead of a DateTime datatype you might use this, that is if
the text is in a format that Access will recognize as a date --
Format(CVDate([User_Input]), "Long Date")
 
It works! Thank you!

KARL DEWEY said:
the user's input
If it is not from a table then where is it from?

If it is text instead of a DateTime datatype you might use this, that is if
the text is in a format that Access will recognize as a date --
Format(CVDate([User_Input]), "Long Date")

--
Build a little, test a little.


Tim said:
Thank you both of you.

Karl, I did do exactly the same thing as you showed to format the long date
in the Query. I also go to the Report and at the date's text field, I format
long date also. But it still just show up the short date. BTW, this field
date is NOT in the database's table, I just capture it from the user's input
and want to display it as Long date. Pls advice. Thx.
 
Back
Top