March 7, 200718 yr I am putting together a simple calendar and i'm having trouble scripting a button to advance my global master date field to the first day of the next month. This field will only have the date of the first of any given month. My first idea was the following script using another field "gMain Month" that is a calc to give me the month name based on the "gMain Date" field: If ( Calendar::gMain Month = "January" ; Calendar::gMain Date + 31 ; If ( Calendar::gMain Month = "February" ; Calendar::gMain Date + 28 ;If ( Calendar::gMain Month = "March" ; Calendar::gMain Date + 31 ; If ( Calendar::gMain Month = "April" ; Calendar::gMain Date + 30 ; If ( Calendar::gMain Month = "May" ; Calendar::gMain Date + 31 ; If ( Calendar::gMain Month = "June" ; Calendar::gMain Date + 30 ; If ( Calendar::gMain Month = "July" ; Calendar::gMain Date + 31 ; If ( Calendar::gMain Month = "August" ; Calendar::gMain Date + 31 ; If ( Calendar::gMain Month = "September" ; Calendar::gMain Date + 30 ; If ( Calendar::gMain Month = "October" ; Calendar::gMain Date + 31 ; If ( Calendar::gMain Month = "November" ; Calendar::gMain Date + 30 ; If ( Calendar::gMain Month = "December" ; Calendar::gMain Date + 31 ) ) ) ) ) ) ) ) ) ) )) Edited March 8, 200718 yr by Guest
March 7, 200718 yr Try: Set Field [ gMainDate ; Date ( Month ( gMainDate ) + 1 ; 1 ; Year ( gMainDate ) ) ]
March 8, 200718 yr Author Works great...Thanks Why is it necessary to have the words "month" and "year" in the calc? I always thought you should replace that stuff with the actual data or fields the calc is looking for but when I remove them it does not work.
Create an account or sign in to comment