Hello everyone,
I have the following formula to check if the fields contains a valid date (dd/mm/yyyy).
if
!isnull(DateTimeParse([_CurrentField_],'%d/%m/%Y')) then 'Valid'
else 'Not Valid' endif
But, I want this formula to only check for those rows which do not contains "-" in the fields. How can I do this? Can someone help??
Solved! Go to Solution.
You can use IF and ELSE IF, maybe something like:
if Contains([_CurrentField_],"-") then "Valid"
else if !isnull(DateTimeParse([_CurrentField_],'%d/%m/%Y')) then 'Valid'
else 'Not Valid' endif
endif
Hi @Pramod91
It looks like you're using a Multi-Field Formula tool? When you say "rows", do you mean that all the dates in a specific row would either have "-" or not?
If this is the case, you can maybe use a filter tool on one of the date fields with a !Contains([Fieldname],"-") expression, then connect the True output to your Multi-Field tool and Union the result with the False output.
If this is not the case and you can't use the filter option and you need to evaluate each date cell individually, then you could perhaps write an expression like:
if !Contains([_CurrentField_],"-") then
if !isnull(DateTimeParse([_CurrentField_],'%d/%m/%Y')) then 'Valid' else 'Not Valid' endif
else [_CurrentField_] endif
Thanks a lot @DavidP , it works!
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
5 |