MacFileman Posted January 2, 2015 Posted January 2, 2015 Hi... Brief history. I used to be very proficient in FM... built databases is V9 in about 2010. Now I am rebuilding all my databases and making them more proficient in V13 for 2015. Yes, they rocked for 5 years! Anyway, need help with a simple code. It is slowly coming back to me... Case (DayName ( SOME DATE ) = "Monday" ; "MON"; "Tuesday" ;"TUE"; "Wednesday" ; "WED"; "Thursday" ; "THUR"; "Friday" ; "FRI"; "Saturday" ; "SAT"; "Sunday" ; "SUN" ; "HELP") I constantly am returned "HELP". What am I missing?? My goal was to abbreviate Day of the week, and Months etc to get them to fit in a small amount of space. Thanks!!
comment Posted January 2, 2015 Posted January 2, 2015 I constantly am returned "HELP". No, not exactly. If SOME DATE is a Monday, you will get "MON" as the result. All other cases will return false because your syntax is incorrect. Going by your method, it needs to be = Case ( DayName ( StartDate ) = "Monday" ; "MON"; DayName ( StartDate ) = "Tuesday" ;"TUE"; DayName ( StartDate ) = "Wednesday" ; "WED"; DayName ( StartDate ) = "Thursday" ; "THUR"; DayName ( StartDate ) = "Friday" ; "FRI"; DayName ( StartDate ) = "Saturday" ; "SAT"; DayName ( StartDate ) = "Sunday" ; "SUN"; "HELP") Of course a simpler method exists, e.g. = Upper ( Left ( DayName ( StartDate ) ; 3 ) ) (do you really need an exception for Thursday?)
MacFileman Posted January 2, 2015 Author Posted January 2, 2015 Funny enough... I solved my problem and figured out my "syntax" error, however your simpler method is freeking genius!! I just never thought about it being as simple as it actually was! SUPER MANY THANKS & HAPPY NEW YEAR!!! Yes... "THUR" can be "THU" BRILLIANT! Thanks for the wake up call! No more responses needed.... problem solved!
Recommended Posts
This topic is 3669 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now