mailmarge date format in word

J

Jaymac

Hi folks

I have a large database which has various fields with dates held in
numerical format. I would like days to be shown in mail merge documents as,
eg 1st 22nd 3rd, etc. and have tried using the pattern "Dte"\@ "dddd, d MMMM,
yyyy" in the mergefield, but this only gives me the US format of the date-day
as a number.

Does anyone have any bright ideas?

Many thanks

Jack
 
A

Arvin Meyer [MVP]

How about:

Function Ordinal (ByVal X As Integer) As String
Select Case Abs(X Mod 10)
Case 1: Ordinal = X & IIf(Right(X, 2) = 11, "th", "st")
Case 2: Ordinal = X & IIf(Right(X, 2) = 12, "th", "nd")
Case 3: Ordinal = X & IIf(Right(X, 2) = 13, "th", "rd")
Case Else: Ordinal = X & "th"
End Select
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top