dates in YYYYMMDD format

  • Thread starter Thread starter dkingston
  • Start date Start date
D

dkingston

Is there a way to get access to recognize dates in
YYYYMMDD format? If so, can I then make the dates output
in MM/DD/yy fomat on reports.
 
DateSerial(Left([DateString], 4), Mid([DateString], 5, 2),
Right([DateString], 2))

will convert you DateString to the correct date in Access / VBA.
 
OK, but where and how do i enter that code?
-----Original Message-----
DateSerial(Left([DateString], 4), Mid([DateString], 5, 2),
Right([DateString], 2))

will convert you DateString to the correct date in Access / VBA.

--
HTH
Van T. Dinh
MVP (Access)



Is there a way to get access to recognize dates in
YYYYMMDD format? If so, can I then make the dates output
in MM/DD/yy fomat on reports.


.
 
Wherever you need the date ... In the Query you used as the RecordSource for
your Report???

If you new to Access, please read an introductory book on Access. You
cannot use Access properly without some background knowledge.
 
dkingston said:
Is there a way to get access to recognize dates in
YYYYMMDD format? If so, can I then make the dates output
in MM/DD/yy fomat on reports.

In MS Access, as with all Microsoft Office products, dates are stored in a
modified Double (float) datatype. This allows math to be performed on them.
What you see is controlled by several factors:

1. The OS language.
2. The OS defaults. These are set in the Control Panel, under Regional
settings.
3. SQL program defaults. (SQL requires mm/dd/yy or mm/dd/yyyy format)
4. The date format.

You can format the date to view it or input it any way by using the Format
and InputMask properties of either a textbox or the field in the table. Just
keep in mind that under the covers you are entering a number, the integer
portion of which is the Date and the decimal portion is the Time. Some very
helpful Date/Time functions are available at the Access Web:

http://www.mvps.org/access/datetime/index.html

There are also a few on my website (listed below). Spend a little time at
these 2 sites and you should find everything you need.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top