Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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?

screenshot20110715at450.png

Kind regards,

Serhat

Posted

In your first script line, you're comparing a date to a year.

Posted

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?

screenshot20110716at111.png

Posted

Instead of Year( get( CurrentDate ) ) create a global number field to store the Year of the calendar.

Posted

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].

This topic is 4898 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.