# Day of the Week Script

This topic is 7770 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

Hi everyone, I am trying to create script that upon which day of the week will do a calculation. Once I have the code that will allow me to dtermine which day it is such as "Monday" "Teusday" I will be golden. It has to do this with out using a find function also, if you guys can help me out I woukld be in your favor. Thanks

##### Share on other sites

For the current day of the week, use:

DayOfWeek(Status(CurrentDate))

##### Share on other sites

When I use that function it places a number in the field I have it set to. Is there a way to have a Left word statement with a loop going thorugh the days of the week, I am not sure about the syntax on this, I am very new to the scripting world of File Maker

##### Share on other sites

a Case statement might work in for you... if i am reading the posts right, i am not exactly sure what you want.. but i will give it a try

Case(

DayOfWeek(Status(CurrentDate)) = 1 , "Sunday" ,

DayOfWeek(Status(CurrentDate)) = 2 , "Monday" ,

DayOfWeek(Status(CurrentDate)) = 3 , "Tuesday" ,

DayOfWeek(Status(CurrentDate)) = 4 , "Wednesday" ,

DayOfWeek(Status(CurrentDate)) = 5 , "Thursday" ,

DayOfWeek(Status(CurrentDate)) = 6 , "Friday" ,

DayOfWeek(Status(CurrentDate)) = 7 , "Saturday"

)

that will give you the day of the week in the field in stead of the number.. i think... i am not positive..

##### Share on other sites

My bad, wrong function. Use: DayName(Status( CurrentDate))

##### Share on other sites

Ok that worked great the only thing is it is not a current date. The field in which I am trying to will be user defined, so it can't be Current date, it would have to go to the field the user sets the date in, see which day of the week that falls on then post the specified date in another field for the status scripting.

##### Share on other sites

excuse me, it needs to find which day of the week the user specified day is on and not date. My bad

##### Share on other sites

I got it, but thank you for the scripting lesson

##### Share on other sites

This topic is 7770 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account