I’m not sure if I can do this in one query but I would like to.
I need all records like this:
SELECT a.field_1, a.field_2, b.field_3, b.field_4
FROM tbl_a AS a, tbl_b AS b
WHERE a.field_1 = b.field_3
And I would like to also exclude these records that fall into this condition:
IF a.field_1 IN (1,2,3,4)
AND a.field_date < NOW()
UPDATE: (sorry for the confusion)
- So if field_1 equals 1,2,3 or 4 and has a date timestamp that is today I need to display the record (add to results)
- And if field_1 equals 1,2,3 or 4 and has a date timestamp that is less than today (remove it from the results).
Any ideas to get both results into one query
Notes (if this makes a difference):
- field_a can have a value a-z, 1-99 (two characters only)
Something like this?