Solved

Can I parse the year from a Date field using a tester?


Badge +2

I have a date being read in from a SDE geodatabase. It is in M/D/YYYY. I have the user input a year. I want to test it against the year in the table and only select the years that match. Is it possible to parse out the year in the tester or do I have to add in a DateTimeConverter Transformer to change the format?

icon

Best answer by andreaatsafe 7 April 2022, 22:01

View original

2 replies

Badge +10

Hi @chris28​ ,

 

You should be able to use a Tester with the "contains" operator. You would have the SDE date as the left value and the attribute holding the user's input year as the right value.

I'm not sure how you have set up the user input year, if the user's input year is from a parameter and isn't tied to an attribute already in the workflow, you'll need to use the ParameterFetcher to put it into an attribute, then you can use the Tester.

 

Here's a sample workflow that I set up using Excel, but the idea of using the ParameterFetcher to the Tester should work for you as well:

DateTester 

-Andrea

Badge +2

Thanks Andrea! That did exactly what I wanted!!

Reply