Constraint on date

Hi All,
i have a question if any one can help me. i want to set a constraint on date. for example

type name label Constraint
date birthdate Date of Birth 02.01.2016 and 03.20.2017

in xlx form design how can i set this constraint??

Regards
Waqar Ahmad

2 Likes

Waqar,

See https://groups.google.com/d/msg/opendatakit/xtB1STXa1Ck/K0E6-DPOBAAJ.

Basically, it's " >= date('2016-02-01') and <= date('2017-03-20')"

You can also use today() for today.

Yaw

··· On Mon, Mar 6, 2017 at 1:41 AM, wrote: > Hi All, > i have a question if any one can help me. i want to set a constraint on date. for example > > type name label Constraint > date birthdate Date of Birth 02.01.2016 and 03.20.2017 > > in xlx form design how can i set this constraint?? > > Regards > Waqar Ahmad > > -- > You received this message because you are subscribed to the Google Groups "ODK Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit-developers+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.
2 Likes

hi yaw
Am tring to access the link to the google group above but am getting this error
"This group either doesn't exist, or you don't have permission to access it. If you're sure this group exists, contact the Owner of the group and ask them to give you access."
And on the restrictio to todays date, do i have to write it as >=date('today()')
or i can just write it as just today()

Thanks
Fula

If you can share your form then we can do more help to you.

" >= date('2016-02-01') and <= date('2017-03-20')"

you should put above constraint in your form and check.

Best,
@iamnarendrasingh

The correct usage is >=date(today()). No quotes.

I have a question anyone can help me.
I type . >= '1919-01-01' and . <= today() in constrain column and I test preview in Enketo is ok but I can't move date in odk collect application after put into the odk folder in tablet. I want to get within 100 years age.

Hi @Yazar
you should use .>=date('1919-01-01') and .<=date(today())

2 Likes

Thanks @Grzesiek2010 for your help. I am ok now with your constraint codes.

thank you so much <3 <3

1 Like