I am working on doing some data transfers moving data from one database to another and I would like to do this without using to much memory on the computer that I am running this data transfer program on. Currently the program is ran every minute, but I want to alter this so that I am fetching data every hour. Ultimately, I want to change the following query so that I am not grabbing just the most value but that I am grabbing data that is from the past hour:
SELECT Data.[Date / Time],
DATA.[Hot Strip Mill Total],
Data.[Basic Oxygen Furnace Total],
Data.[Electro-Arc Furnace Total],
Data.[J-9 Shop Total],
Data.[Levy Maintence Building Total],
Data.[Ford Body Shop Total],
Data.[Ford Chiller Building Total],
Data.[Ford Dearborn W Plant Total],
Data.[Ford Dearborn E Plant Total],
Data.[Ford Dearborn Balcony Total],
Data.[Ford Final Assembly Total],
Data.[Ford Frame Plant Total],
Data.[Ford Dearborn N Plant Total],
Data.[Ford Tool and Die Total],
Data.[Ford Paint Plant Total],
Data.[Ford Glass Plant Total],
DATA.[Hot Strip Mill Rate],
Data.[Basic Oxygen Furnace Rate],
Data.[Electro-Arc Furnace Rate],
Data.[J-9 Shop Rate],
Data.[Levy Maintence Building Rate],
Data.[Ford Body Shop Rate],
Data.[Ford Chiller Building Rate],
Data.[Ford Dearborn W Plant Rate],
Data.[Ford Dearborn E Plant Rate],
Data.[Ford Dearborn Balcony Rate],
Data.[Ford Final Assembly Rate],
Data.[Ford Frame Plant Rate],
Data.[Ford Dearborn N Plant Rate],
Data.[Ford Tool and Die Rate],
Data.[Ford Paint Plant Rate],
Data.[Ford Glass Plant Rate]
FROM DATA
WHERE Format(Data.[Date / Time], 'mm/dd/yyyy hh:nn:ss') >=
(select Format(max(Data.[Date / Time]),'mm/dd/yyyy hh:nn:ss') from Data);
As in, it is now 10:51:00AM, my program is now running it would return data from greater than 09:51:00AM until now, Likewise at 11:51:00AM, return data from greater than 10:51:00 until 11:51:00AM. I am not that famililar with Access but I am fairly capable with queries. This one just has me lost. Can anyone help understand how accomplish this? Thanks
Since 1 day = 1, therefore 1 hour = 1/24. So -just for fun - you could even express your condition as
WHERE Data.[Date / Time] >= (Now()-1/24)