Format DatePart to show the month in words

Dumferling

Member
Local time
Today, 23:29
Joined
Apr 28, 2020
Messages
102
I have this:
SortByMonth: Format(DatePart("m",[DatePublished]),"mmmm")
DatePart gives me a number for the month but I want to show that as a name. The above defaults everything to January so that I get:
1679482241726.png

rather than the words for each of the months.
1679482287659.png

Is there another way to do this?
 
Code:
Format(DatePublished, "mmmm")
But the following sorting is probably much different than you expect.
 
Code:
Format(DatePublished, "mmmm")
But the following sorting is probably much different than you expect.
OK, I see. That works if I put it in a different colum. I was trying to convert the DatePart but that was overcomplicating it. Thank you.
 
Code:
Format(XXX, "mmmm")
... expects a valid date for XXX, the numbers from DatePart are reinterpreted accordingly:
Code:
? CDate(1), CDate(2), CDate(12)
31.12.1899    01.01.1900    11.01.1900
 

Users who are viewing this thread

Back
Top Bottom