How do I restrict D.O.B entries to children over 6 months from today()?

(Eva) #1

Hie Guys,

I am trying to figure out how i can put a validation condition in my form
that that only accepts D.O.B that is for 6months olds or older.
will today() - 182 work? whats the correct syntax ?

(Eva) #2

Thanks Clayton…I succeeded

··· On Tuesday, March 14, 2017 at 9:53:30 AM UTC+2, Eva wrote: > > Hie Guys, > > I am trying to figure out how i can put a validation condition in my form > that that only accepts D.O.B that is for 6months olds or older. > will today() - 182 work? whats the correct syntax ? >
(Clayton Sims) #3

Hi Eva,

You may find this page helpful:
https://confluence.dimagi.com/display/commcarepublic/Calculations+with+Dates+and+Times

You are correct in your calculation, you just need to use a period
character to refer to the “current” question in the validation condition

. < (today() - 182)

-Clayton

··· On Tue, Mar 14, 2017 at 1:23 PM, Eva Tsitsi Chigodo wrote:

Hie Guys,

I am trying to figure out how i can put a validation condition in my form
that that only accepts D.O.B that is for 6months olds or older.
will today() - 182 work? whats the correct syntax ?


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

(kerow) #4

Similar scenario i had. I target children below 2 years and below is how i executed my validation condition;
. < today() and . > date(today() - 720)