working with time

  • Thread starter Thread starter VilMarci
  • Start date Start date
V

VilMarci

Hi,

I have a table that stores interview dates & times.
The time is selected from a combo box. The source of this box is a query
based on a table like:
TimeID,TimePt
1,9:00
2,9:15
....
37,18:00

This list is then reduced by a query (qReservedTime) that looks up the
reserved timepoints on the given date like this.

TimeID,TimePt
3,9:30
5,10:00

How is it possible to return values that are closer than 30 mins (or the id
difference is less than 2)

Thanks in advance,
Marton
 
Here's one way:

SELECT Table1.timeval, Table1.id, Table1_1.timeval, Table1_1.id, *
FROM Table1, Table1 AS Table1_1
WHERE (((Table1_1.timeval) Between [table1].[timeval] And
DateAdd("n",30,[table1].[timeval])))
ORDER BY Table1.timeval, Table1_1.timeval;
 
Back
Top