G
Guest
I'm trying to follow the instructions below from a posting by Doug Steele on
1/25/2005. (Search For: Combining Text And Date Vaules). At the time, I
followed John's suggestion without reading the entire thread and I am just
now finding that this doesn't work in all cases.
I want to try Doug's suggestion and, I understand what I need to do as far
as changing the query, but I am not sure of where I need to be to "write my
own function". Can someone help?
Thanks.
------------------------
Doug's suggestion from posting follows:
You'll have to write your own function, along the lines of:
Function OrdinalDate(ValueIn As Long) As String
Select Case ValueIn
Case 1, 21, 31
OrdinalDate = ValueIn & "st"
Case 2, 22
OrdinalDate = ValueIn & "nd"
Case 3, 23
OrdinalDate = ValueIn & "rd"
Case Else
OrdinalDate = ValueIn & "th"
End Select
End Function
Change your query to
LegalDate: "This " & OrdinalDate(DatePart("d", [OrderDate])) & " day of " &
Format([OrderDate],"mmmm") & ", " & Format([OrderDate],"yyyy") & "."
1/25/2005. (Search For: Combining Text And Date Vaules). At the time, I
followed John's suggestion without reading the entire thread and I am just
now finding that this doesn't work in all cases.
I want to try Doug's suggestion and, I understand what I need to do as far
as changing the query, but I am not sure of where I need to be to "write my
own function". Can someone help?
Thanks.
------------------------
Doug's suggestion from posting follows:
You'll have to write your own function, along the lines of:
Function OrdinalDate(ValueIn As Long) As String
Select Case ValueIn
Case 1, 21, 31
OrdinalDate = ValueIn & "st"
Case 2, 22
OrdinalDate = ValueIn & "nd"
Case 3, 23
OrdinalDate = ValueIn & "rd"
Case Else
OrdinalDate = ValueIn & "th"
End Select
End Function
Change your query to
LegalDate: "This " & OrdinalDate(DatePart("d", [OrderDate])) & " day of " &
Format([OrderDate],"mmmm") & ", " & Format([OrderDate],"yyyy") & "."