Why do the dates not match in this function?
Hi,
We are trying to write a Function that checks to see if a valus is a date and, if so, formats it (for consistency). It then does the same for the other date and compares.
Using the parameter values below it doesn't seem to recognise them as the same date and returns a false when the dates are the same, just that the format is different.
Anything we are doing wrong?
Thanks
Best Answers
-
Hi @Nigel Light, when you apply the 'Format date' function to the date its type is changed to alphanumeric, which causes the check for equality to fail since it is comparing alphanumerics instead of dates.
You can check that by adding the 'Datatype' function before and after the 'Format date' step, which will tell you what are the types of the values.
Here is an example:The results are:
3 -
Hi
Thanks for getting back to me - really helpful and I think we have a solution now
Nige
1 -
Hi Nige,
Basically Equals only looks at the alphanumeric charaters everything else ignored. If you change "Equals" to "Equals (Strict)" you will then get the expected results.
The "Remove white space" function removes "Space", "tab", "line feed (newline)", "carriage return", "form feed", and "vertical tab".
1
Answers
-
Taking this 1 step further, comparing National Insurance Number fields - the results are as required (ie ignoring case and any spaces) for the following examples, other than it matches with the inclusion of dashes in the 2nd NI No value in example 6. Matching using an "equals (strict)" gives the correct results. Is this a similar case of data type?
0 -
Ah… I get it.
Thanks
Nige0