I've got two tables, one called events, which has an id field (eventid), a name field (eventname), a start date (datefrom) and an end date (date to), and another called events_to_grouptype, which has an event id and a group type id, which refers to another table which stores the names of various different types of events.
What I want to do is select all the events that have a particular group type id and are current events (i.e. the start or end date is more than or equal to the current timestamp).
Here's my query, but it seems to be returning all the events, regardless of date:
Expand|Select|Wrap|Line Numbers
- SELECT DISTINCT events_to_grouptype.eventid FROM events, events_to_grouptype WHERE events_to_grouptype.typeid = '2' AND ((events.datefrom >= 1205227784) OR (events.dateto >= 1205227784))
Cheers