I am trying to get the right syntax around a select statement. Here is what I am trying to do.
I am selecting rows from a table based on date ranges that works fine. Where i am getting stuck is there is a third field i need to include that will either have a value or if it's left blank i need to return all the rows for the date range or i need to return all the rows for the date range and with the selected PAY_CYCLE
I was trying to do it with an AND OR
This is the specific syntax I am having issues with is the and or correct to use in this case? What should i use in my OR clause?
AND (A.PAY_CYCLE = :1 OR A.PAY_CYCLE = ?)
Any help is appreciated!
I am selecting rows from a table based on date ranges that works fine. Where i am getting stuck is there is a third field i need to include that will either have a value or if it's left blank i need to return all the rows for the date range or i need to return all the rows for the date range and with the selected PAY_CYCLE
I was trying to do it with an AND OR
This is the specific syntax I am having issues with is the and or correct to use in this case? What should i use in my OR clause?
AND (A.PAY_CYCLE = :1 OR A.PAY_CYCLE = ?)
Any help is appreciated!
Comment