Selecting a Date Year

Can someone explain what is the problem here?

In PanX, I write

Select datepattern(«Date»,"MMMM") = Tax_Year

Tax_Year is text in the form “2022”. The above code works perfectly in Pan6. In PanX, the entire database is selected, as if the Boolean result is nul.

This will produce “MMMM” since “MMMM” is not a recognized pattern. You should be using datepattern(«Date»,“yyyy”) to produce the year.

My Gosh. I’m really slipping!
Thanks, Gary

And doesn’t Tax_Year have to be Text? Seems it would be easy to mistype it as numeric.

When you say it’s in the form of “2022” I don’t want to assume those quotes mean it’s “text”.

That’s what Vic said it was.

Ah, I missed that and focused on the “2022” which, to me, only implied text.

It’s like in High School driving class when they tell students that when someone’s turn signal is on, that means they are going to turn. After you’ve been on the road a bit, you might interpret the turn signal as a suggestion that they will make a turn and that they might not make a turn and they might make a turn and change their mind at the last moment after they see the street sign.

So it was with just “2022” as text.

But you are right, Dave. Vic said it right there, “Tax_Year is Text in the …”

I need remedial reading.