You will need to create the ordinal as a test field in an Access query
before doing the import into Publisher. I found that I could create an
ordinal with the date first until I'd reformatted my date as text without
the slashes (/). First place the following function in a standard module
so that you can call it in a query:
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
Then build this query in Access, adding the fields you need:
SELECT Ordinal(Left([Expr2],2)) & " " & Format$([DateField],"mmmm") & " "
& Format$([DateField],"yyyy") AS Expr1, Format$([DateField],"ddmmyyyy") AS
Expr2, tblMyData.DateField
FROM tblMyData;
Replace the field and table names. DateField will be the name of your date
field and tblMyData is the name of your table.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
swarfmaker said:
I'm using Publisher to print certificates, pulling data from MSAccess
database. The date field I'm using is formatted as LongDate in Access (6
August 2006)but shows as ShortDate (06/08/2006) in Publisher. Is there
any way to show this as LongDate in Publisher? Ideally, I'd like it to be
formatted with Ordinal numbers, i.e. 6th August 2006.
TIA
Iain