Easy if you know how

colmoore

Registered User.
Local time
Today, 09:50
Joined
Oct 20, 2004
Messages
34
Hi all,

I am making a query which sorts birthdays into chronological order.

I have used the DatePart function to determine the month:

DatePart("m",[DATE OF BIRTH])

But I want to know how to display the month in CAPITAL LETTERS, i.e. instead of reading 1 it reads JANUARY

Thanks in advance
 
Hi

Try using this instead :

Format(Format(Month([DATE OF BIRTH]),"mmmm"),">")

HTH, Andrew
 
Close!

Hi andrew,

Thanks for this. They're all coming out as JANUARY though :confused:

Any ideas???
 
Alternativly just wrap you function with the MonthName() function and stick the ">" in the Format filed of the control :)

CapMonth: MonthName(DatePart("m",[DATE OF BIRTH]))

peter
 
Always at least 3 ways to skin a cat in Access :D

peter
 
Yes and I don't know why the DatePart function is being used at all here,
Month([DOB]) will return the numeric value to sort on ;)
 
If you want to sort the birthdates for the current year use:

CurrBirthDay: DateSerial(Year(Date()),Month([DOB]),Day([DOB]))

This will display the birthdate for the current year so it can be sorted chronlogically.

If you then want to display the date in a specific format you can use the Format function.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom