If I’m reading your query correctly, you have:
SELECT ...
FROM <TABLE>
WHERE <EXPRESSION>
WHERE <EXPRESSION>
....
That isn’t valid SQL. A SQL query can only have a single WHERE expression. If you want the expression to have multiple predicates, you would conjoin them with “AND” … for example
SELECT ....
FROM <table>
WHERE <EXPRESSION> AND <EXPRESSION>
This implies that the issue is not at all related to the data formatting but it is related to SQL grammer in general.