January 2, 201511 yr 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!!
January 2, 201511 yr 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?)
January 2, 201511 yr Author 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!
Create an account or sign in to comment