7.5 Excercise >  Cannot apply '>' operator to 'Date' together with 'Integer'
Question
Service Studio Version
11.14.7 (Build 58100)

Hi, I'm still studying traditional development and I need to validate this

1. Add validation to the Save Action in the PersonDetail Screen that verifies that the date of birth needs to be before the current date(please see the screenshot below).


I've just started this course, so if you give me a reference I'm very grateful.
Thanks

2022-02-24 01_34_08-.png
Solution

I think you have to do the same thing to the date birth using the Year method.

Year(CurrDate())>Year(CurrDate())

Kind Regards,

Márcio

Hello Angelo,

At beginner level it may be difficult to understand so here is a simple way to check if the birth date is less than current date or not

PersonForm.Record.Person.DateofBirth < Currdate().

Regards,

Pavan R

Hi @angelo garcia 


you are comparing a dateTime or date is greater than a year value.

You have to compare 2 values of the same type.

If you gonna get the year from the current Date you have to get the year from the PersonForm.Record.Person.DateofBirth.

Or you put only the year from the 2 dates like this:

Year(CurrDate())>Year(CurrDate())

Or with date type like this 

PersonForm.Record.Person.DateofBirth < Currdate().


Remember you can only compare 2 values from the same type

thank you so much for your answer.

Solution

I think you have to do the same thing to the date birth using the Year method.

Year(CurrDate())>Year(CurrDate())

Kind Regards,

Márcio

Hello Angelo,

At beginner level it may be difficult to understand so here is a simple way to check if the birth date is less than current date or not

PersonForm.Record.Person.DateofBirth < Currdate().

Regards,

Pavan R

Hi @angelo garcia 


you are comparing a dateTime or date is greater than a year value.

You have to compare 2 values of the same type.

If you gonna get the year from the current Date you have to get the year from the PersonForm.Record.Person.DateofBirth.

Or you put only the year from the 2 dates like this:

Year(CurrDate())>Year(CurrDate())

Or with date type like this 

PersonForm.Record.Person.DateofBirth < Currdate().


Remember you can only compare 2 values from the same type

thank you so much for your answer.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.