• I think your sql is correct - the reason no rows are being returned is because there is no data that falls within the date range of your parameters.

    If you change the sql to

    ((datod between '20020101' AND '20021231') OR (datdo between '20021201' AND '20021231')) you will see you get 1 row returned.

    In your data set there are no rows that have datod or datdo between 01-Dec-2002 and 31-Dec-2002 which is what you have your variables set to.