Does anyone know how to get the day of the week from a date field, i'e
a date of 05-08-2024 (5th August) would return either a number 1 or 'Monday'
Regards
Alan
Hi Alan,
If you are trying to use the Visual supplied ORDER_DATE variable, you could use the WeekDay function to determine the numeric day of the week for the date value in that variable. For today's date, use Now, rather than a variable name with that function. In some parts of the world, the first day of the week is Sunday, while in other parts of the world the first day of the week is Monday. To force Monday to be the first day of the week, specify vbMonday as the second parameter of the WeekDay function: 'vbMonday is specified to force Monday to be the first day of the week, rather than Sunday if Sunday is considered the first day of the week in your regionMsgbox WeekDay(ORDER_DATE, vbMonday)
To show the name of the weekday, use the WeekDayName function with the WeekDay function, as shown below:'Show the day name for your region for the Order DateMsgbox WeekDayName(WeekDay(ORDER_DATE))
There is a 16 part article series on the topic of Visual macros in the VMIUG-TEC Google Group, if you are looking for more information about Visual macros:groups.google.com/.../vmiug-tec
Charles HooperSenior Software EngineerMeadville Forging Company