cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
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