Page 1 of 1

DATE Problem with 7.1 version

Posted: March 22nd, 2018, 4:14 am
by arkagwa
Dear Josh and ALL

i have observation on date variable since beta version

I have variable date in the dictionary and i have set it in the form (Field properties) as date in format DDMMYYYY. My valid range is 01012018 to 02032018 and Not declared as =11111111. This varible has to be entered by clicking date panel. I am trying to enter 10012018 and CSPro returns error" out range , enter a valid date" this is wrong error. But when i change date format to YYYYMMDD and i change the range of dates in this format (YYYYMMDD) it works.
This looks like dates are validated only in format YYYYMMDD even if no code to change it, when already declared as date in new CSPro7.1. Moreover date=systemdate("DDMMYYYY") works fine
Screenshot 2018-03-22 10.40.042.png
Screenshot 2018-03-22 10.40.042.png (24.75 KiB) Viewed 3909 times
Screenshot 2018-03-22 10.40.042.png
Screenshot 2018-03-22 10.40.042.png (24.75 KiB) Viewed 3909 times
Screenshot 2018-03-22 10.40.042.png
Screenshot 2018-03-22 10.40.042.png (24.75 KiB) Viewed 3909 times

Re: DATE Problem with 7.1 version

Posted: March 22nd, 2018, 4:21 pm
by aaronw
The date you've selected is larger than any date in your range. Look at the two most significant digits. 10-01-2018 is greater than any number in your range 01-01-2018 to 02-03-2018.

For this reason I think it makes sense to work with dates in the format YYYYMMDD. Otherwise, days (the smallest granularity of time in your date) are your most significant digits.

Re: DATE Problem with 7.1 version

Posted: March 23rd, 2018, 2:40 pm
by segxy4manu
Am not sure you need value set in this case as you've declared it already in form (field properties) as "DDMMYYYY" just remove the value set and try again or you use syntax to pick system date

Re: DATE Problem with 7.1 version

Posted: March 23rd, 2018, 5:17 pm
by Mariovaisman
Hello,

I didn't check your app, however, when you have to define a valid range of dates, you need to collect the data in YYYYMMDD format, because the variable is numeric, and Jan 31 2018 is bigger than Jan 1 2019.

Thanks

Mario