This should work, but should look something like
select table2.testfield FROM table2, table1 WHERE table1.YourField = '2011-02-24 18:00:00' AND NOT BETWEEN table1.start AND table1.finish
This also assumes that your table1.start and table1.finish are of type DateTime . If it is not, you can try Casting Fields.
select table2.testfield FROM table2, table1 WHERE table1.YourField = '2011-02-24 18:00:00' AND NOT BETWEEN Cast(table1.start as DateTime) AND Cast(table1.finish As DateTime)
Change In response to your question, I realized that the date is probably not a database value :), so your method should work, but you may need to pass a string to datetime.
source share