[AccessD] Find nearest query troubles

Kaup, Chester Chester_Kaup at kindermorgan.com
Tue Jun 22 14:07:34 CDT 2010


I have one table that has a date time column and one field of data (PSI), I have a second table that has a date time column and one field of data (temperature). The date time fields in the two tables to not match. I need to find the nearest date time in the second table that is not greater then the time date in the first table for each record and extract the temperature field from the second table. I have attempted to write a query but I get the same temperature for each date time in table one. Here is what I have. I think I have something turned around here. Thanks for looking.

SELECT dbo_S_CO2_System_Pressures.Date, dbo_S_CO2_System_Pressures.PSI, (Select Min([Temp]) from [tbl Temperature]
where [tbl temperature].[Date Time]< dbo_S_CO2_System_Pressures.Date) 
AS Test
FROM dbo_S_CO2_System_Pressures
WHERE (((dbo_S_CO2_System_Pressures.Date)>#6/1/2010#))
ORDER BY dbo_S_CO2_System_Pressures.Date;



Chester Kaup
Engineering Technician
Kinder Morgan CO2 Company, LLP
Office (432) 688-3797
FAX (432) 688-3799

 
No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.





More information about the AccessD mailing list