Trouble matching formatDate for Weekday with returned value

This seems like it should be so easy… but it’s baffling me. The user enters a date and the program creates a set of database records where one of the fields is dependent on the day of the week from the entered date. An example using the formatDate(EnteredDate;“dddd”) to get output:


To create the MySQL database record, I tried both Switch and If statements with no luck. I image this is a data type problem? But I just don’t know what to try next:
Switch sample:

If sample:

The result is blank:

Weirdly, it does provide a result when I change the to the ‘regular’ = sign:

But is just showing the result of the first If statement - not the one it should be matching…
Appreciate any guidance you can provide.
Thank you!

Sometimes, you just have to write it out and think about it a different way. I changed my formatDate(EnteredDate;“dddd”) to ParseNumber(formatDate;“d”)) and was then able to use the resulting number in the comparison successfully if(weekday=0; sunday)… etc…

2 Likes

Your Weekday variable here had double quotes around the value, so it did not match your switch statements as those did not have double quotes.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.