Page 1 of 1

Filtering out a specific date

Posted: Thu Nov 02, 2017 10:03 am
by mjohnson62982
I am trying to filter out a specific expiration date. I am currently using a filter stage with a where clause:
Level_Status_Expiration_Date <> '1900-01-01'
I get the following error:
Expiration_Date_Filter: Parse error: Expected 'is' statement ('is true', 'is false') or boolean operator (and, or) got: "-01".
What would the best way to exclude records with this expiration date?

Posted: Thu Nov 02, 2017 10:36 am
by qt_ky
The logic you have should work fine. Double check to make sure you don't have the word 'is' or any extra stuff like that floating around in the Filter stage or in its where clause.

Posted: Thu Nov 02, 2017 10:40 am
by mjohnson62982
Here is the copied text of what I have in the Where Clause...

Code: Select all

Level_Status_Expiration_Date <> 1900-01-01

Posted: Thu Nov 02, 2017 11:57 am
by chulett
So... quoted or not quoted? You've shown it both ways now. I'd also like to know if your "expiration date" field's datatype is a date or a string.

Posted: Thu Nov 02, 2017 12:07 pm
by mjohnson62982
Sorry it is not quoted, and the field's datatype is date. Thanks.

Posted: Thu Nov 02, 2017 5:21 pm
by chulett
I'm not sure how picky the Filter's where clause conditions are and if it supports direct comparison to a DATE field like that. From looking at the documentation, you may be better off converting that date to a string and then filtering on the resulting string date.

Posted: Mon Nov 06, 2017 1:58 am
by ray.wurlod
Try enclosing the date constant in single quote characters.

Not sure where the "is" message is coming from. You might consider inspecting the generated OSH, or dumping the job score, to investigate this.

Posted: Fri Nov 10, 2017 11:40 am
by sriven786
Filtering Date with Quotes (Just like SQL Where Clause) is not giving any Issue: Example: date_1 <> '1900-01-01' (Filtering without Quotes thinks its a Condition and expecting operators)