I am trying to retrieve records for the past 24 hours .. from a table. I have 2 DateTime fields .. named TransDate and TransTime containing for example 2014/09/25 and 12:45:45 PM respectively.
(I know they are not stored this way ... )
However .. because they are in separate fields .. I cannot find how to make this happen. If they are in one field in the table .. ie 2014/09/25 12:45:45 PM then I can use DateAdd as below and it works fine.
I can use criteria of .. DateAdd("s",-86400,Now()) .. and I get the 2 records I expect.
I do not want to combine them into one field in the table .. as that just complicates things elsewhere, and there are over 4 million records in the table .. and I want to keep the table as small as possible
I am using this in a query .. and need a criteria that will work. The below does not work ...
Select * from Transmissions Where TransDate > DateAdd("s",-86400,Now()) And TransTime > DateAdd("s", -86400,Now());