I have a mysql query like this
SELECT id, dpost FROM uid1088_qposts
UNION
SELECT id, dpost FROM uid1091_qposts
WHERE DATE(dpost)='2012-01-01'
but the dpost column is a datetime column which stores a data like this
2012-01-12 11:55:43
the query shows no errors but produces a wrong output

is there anyway i can union two tables using a where clause in this kind of filtering?
the two tables does not unite… only the first queried table shows its data and filters a wrong date
In your case your code is interpreted like :
if you want to filter all of your lines use