Dear all,
Sorry to bother you: Not really a PhP question, although it is pure database related..
A friend of mine set-up a horrible database, and now I am trying to solve some of her work. But i have no clue of access SQL!
What I try to do:
I have a table with oberservations, with multiple fields, some selected here:
observations.start, observations.end, observation.obser date
Now I want to for a certain day, know whether observations were made at a certain time, say, each 15 seconds of a day (This interval is dynamic). (This is some animal behavioural database). This will of course result in duplicate records when any observtion lasts longer then the sampling interval, whic is desired
What I came up with: I added a table NATURALS with intergers: 1..65 000.
My thought: I can multiply the sampling interval with the integer colum, and then do a select based on that. Please find the SQL below:
PARAMETERS [Day] DateTime, SamplingInSeconds Long;
SELECT (N.N-1)*SamplingInSeconds AS Sample, P3.*
FROM [P-3 Video observations corrected data] AS P3, Naturals AS N
WHERE (((([N].[N]-1)*[SamplingInSeconds]) Between (Hour([Start])*3600+Minute([Start]*60+Second([Start]))) And (Hour([End])*3600+Minute([End]*60+Second([End])))) AND (([Day])=[P3].[Obser date]));
Unfortunately, this does not even get close to selecting all the records. Is theer an ACCESS wizz here who can have a quick peek at the code?
Thanks!
J.