Date & Month

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I have the following expression to create an ID in a
query...

ID: UCase([Student Details]![Surname] & Left([Student
Details]![Forename(s)],1) & Year([Student Details]![Date
Of Birth]) & DatePart("m",[Student Details]![Date Of
Birth]) & Day([Student Details]![Date Of Birth]))

....fun, yes?

The section below will only give me 1 & 2 character month
values e.g: March = 3

DatePart("m",[Student Details]![Date Of Birth])

I need this to always be double figures (March = 03), but
if i put a second "m" in it won't activate the query.

Month() only gives 1 & 2 character aswell.

Any ideas peeps?

Lexx
 
ID: UCase([Student Details]![Surname] & Left([Student
Details]![Forename(s)],1) & Format([Student Details]![DateOf Birth],
"yyyymmdd")
 
Back
Top