date without dashes and colons ms access + can date be part of autonumber?

0

I want the date (22-12-2018) without dashes and colons in Ms Access for a field. How can I achieve it? Also is there some way to change the alignment i.e. (22-12-2018) should be 22122018 or 12222018 or 20181222.

I want to include it (date) to be part of Autonumber in records for field. Is that achievable?

NewAtSQL

Posted 2019-06-06T16:39:56.120

Reputation: 27

Answers

1

To obtain the date format described in your question, use the Format function with the following arguments:

Format(Date(), "ddmmyyyy")

e.g.:

?Format(Date(), "ddmmyyyy")
08062019

Whilst you can change the display format of an AutoNumber to display static content surrounding the incrementing section of the field, by changing the Format property to something like:

"ID"000

This does not change the actual data held by the field, but only the way that such data is displayed by the field (the field will still contain an incrementing Long Integer).

You also cannot use expressions within this Format property, and so you would not be able to insert the current date as a prefix.

Lee Mac

Posted 2019-06-06T16:39:56.120

Reputation: 763

0

Found the solution to one part:

Format(Date(), "mmddyy")

But my question still remains for the date to be part of autonumber, let me know if it can achieved?

NewAtSQL

Posted 2019-06-06T16:39:56.120

Reputation: 27