258
Views
1
Comments
Solved
DayofWeek() to text

DayofWeek() returns me an integer (0 to 6), how can I get the first letter of the day of the week?

2016-04-22 00-29-45
Nuno Reis
 
MVP
Solution

Hello Sérgio.

A standard function to return dates as text is doomed because languages are very different. FormatDateTime is in English but it can return the full weekday name or shortened. (check the doc, it is 'ddd' for the 3 letter version, 'dddd' for the full name).


So, you want something like SubStr(FormatDateTime(Date, "ddd"),0,1), the first letter of the day name.

In other languages you can do your own logic to change the weekday number into a string, either with full name or only the initial.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.