cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
twillkickers
Level III

Check if a date is within a specified date range

Is there a way in JSL to check if a given date and time is within a specified date range?

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: Check if a date is within a specified date range

JMP's < operator can compare multiple values strung together:

date = 6aug2018;
if ( 1jan2018 < date < 1jan2019, "good", "bad");

"good"

 

If your data has missing values, you'll need to test for them. If statement blog.

 

update: here is an example, look for

target > now > target - In Hours( 100 )

about half way down. change the target to target = today()+100; to see the effect.

Craige

View solution in original post

1 REPLY 1
Craige_Hales
Super User

Re: Check if a date is within a specified date range

JMP's < operator can compare multiple values strung together:

date = 6aug2018;
if ( 1jan2018 < date < 1jan2019, "good", "bad");

"good"

 

If your data has missing values, you'll need to test for them. If statement blog.

 

update: here is an example, look for

target > now > target - In Hours( 100 )

about half way down. change the target to target = today()+100; to see the effect.

Craige

Recommended Articles