Geoff Codd
Registered User.
- Local time
- Today, 22:13
- Joined
- Mar 6, 2002
- Messages
- 190
I am trying to create a query which shows the one yers rates against the others side by side.
ie
31/01/02 5p 31/01/03 5.5p
I am geting the data from one table which is a continuous list of month and rate.
I tried the following query
SELECT [qryEnergy_Report_Data_Unit_Rate_(Table_3)].Code, [qryEnergy_Report_Data_Unit_Rate_(Table_3)].Code2, (Select[Unit_Rate]from [qryEnergy_Report_Data_Unit_Rate_(Table_3)]where[Date]<#31/01/2003#) AS PrevUnit, (Select[Unit_Rate]from [qryEnergy_Report_Data_Unit_Rate_(Table_3)]where[Date]>#31/01/2003#) AS PresUnit
FROM [qryEnergy_Report_Data_Unit_Rate_(Table_3)];
But I get the error - "At most one record can be returned by this subquery"
Does anyone have any ideas as to how I can do this in one query
Thanks in advance
Geoff
ie
31/01/02 5p 31/01/03 5.5p
I am geting the data from one table which is a continuous list of month and rate.
I tried the following query
SELECT [qryEnergy_Report_Data_Unit_Rate_(Table_3)].Code, [qryEnergy_Report_Data_Unit_Rate_(Table_3)].Code2, (Select[Unit_Rate]from [qryEnergy_Report_Data_Unit_Rate_(Table_3)]where[Date]<#31/01/2003#) AS PrevUnit, (Select[Unit_Rate]from [qryEnergy_Report_Data_Unit_Rate_(Table_3)]where[Date]>#31/01/2003#) AS PresUnit
FROM [qryEnergy_Report_Data_Unit_Rate_(Table_3)];
But I get the error - "At most one record can be returned by this subquery"
Does anyone have any ideas as to how I can do this in one query
Thanks in advance
Geoff