Create a query to show rows with timestamps in between two times

charlesfchang

New member
Local time
Tomorrow, 05:59
Joined
Jun 18, 2013
Messages
6
Hi Experts,

has anyone done to Create a query to show rows with timestamps in between two timestamps? my variables are cutoff time and the current time where cutoff time is saved on a table (tblcontroltable.cutoff)

a pseudo code of what i want to achieve is

select date, product, timestamps
from tblsample
where date = date and timestamps > cutoff and timestamps < time
 
Let me to understand, please.
So, you have a set of records, order by a DATE field (Ascending order).
For the first record the time stamp would be 0 (Zero)
Starting with the second record, the time stamp should be
Time for current record minus time for previous record.

Is this what you are looking for ?
 
not necessarily zero but any value of time() can be the start/cutoff record (Start because it can start at any record, not the first only.) and the end value should be the time during the a cmd button is clicked.

in essence, everything that is between cutoff and cmdbutton.value = time() should be returned by the query.
 
I hope that you do not have a field named Date an Access reserved word

Try , untested

Select mydate,product,timestamp
From mytable
Where mydate=requireddate and timestamp between cutoff and Timevalue( Now())

Brian
 
As an after thought , why do your time stamps not contain the date, it is much simpler to handle full date and time values than split values and if there are situations where you only want the date or time then Datevalue or Timevalue easily gives that.

Brian
 

Users who are viewing this thread

Back
Top Bottom