July 15, 201114 yr Hello guy's I have a question. as you can see on the image the layouts shows the records of current year 2011. i have a script that allows me to go to the next year (script on the image), but if the layouts shows the current year i want to prevent that the scripts stops because there are no records at the moment of year 2012. I tried something but nothing helped, how can i do this? Kind regards, Serhat
July 15, 201114 yr Try something like: If [ Year ( YourTable::YourDateField ) < Year ( Get (CurrentDate) ) ] # DO THE THING ... Else Beep End If
July 16, 201114 yr Author Try something like: If [ Year ( YourTable::YourDateField ) < Year ( Get (CurrentDate) ) ] # DO THE THING ... Else Beep End If Thank you very much it works I want also this for the previous year. i have 2009 as latest records. how can do it for previous years?
July 16, 201114 yr Instead of Year( get( CurrentDate ) ) create a global number field to store the Year of the calendar.
July 16, 201114 yr I want also this for the previous year. i have 2009 as latest records. I think you mean earliest? How about: If [ Year ( YourTable::YourDateField ) > 2009 ] ... I am not too crazy about hard-coding data, but if you're not backdating records, it should do. Otherwise you'd have to do something like: Set Variable [ $firstYear ; Year ( sMinDate ) ] Freeze Window Show Omitted Only Set Variable [ $firstYear ; Min ( $firstYear ; Year ( sMinDate ) ) ] Show Omitted Only If [ Year ( YourTable::YourDateField ) > $firstYear ] ... where sMinDate is a summary field defined as Minimum of [YourDateField].
Create an account or sign in to comment