Unable to update records

H

Henry

I would like to compare the values of one record with another record for the
previous year, for example to calculate growth. I can extract and calculate
these values using the SQL below however I am unable to update the records
as I am told the recordset is not updatable in MS Access.

Create table Results
(ResultID INT IDENTITY,
ResultYear DateTime,
ResultValue Int)

INSERT INTO Results (ResultYear, ResultValue) VALUES('1 Jan 2005', 500)
INSERT INTO Results (ResultYear, ResultValue) VALUES('1 Jan 2003', 30)
INSERT INTO Results (ResultYear, ResultValue) VALUES('1 Jan 2004', 100)
INSERT INTO Results (ResultYear, ResultValue) VALUES('1 Jan 2002', 20)


SELECT t1.ResultID, t1.ResultYear, t1.ResultValue,
t1.ResultValue-t2.ResultValue AS Growth
FROM Results t1 LEFT JOIN Results t2 ON t2.ResultYear=DATEADD (yyyy , -1,
t1.ResultYear )

Any help here would be greatly appreciated.

Thanks

Henry
 
M

Michel Walsh

Hi,


A non-equi join marks the query as not updateable (in addition to the
computed field which is not).

Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top