Hi All.
I've got a real 'blue-sky' question here. This is what I want to do. I have a crosstab query with various items of furniture as the row headings, Years (2004, 2005 etc) as the column headings, and amounts of money as the values. SO you can see how much to spend on chairs in 2008, for instance.
For every project that is entered into the database, you would typically run this query once. All well and good. However, what I would like to do is store the costs in years against each item so that as the project database builds up, you can see ACROSS ALL PROJECTS (sorry for caps, thats the important bit), what you are going to spend on a certain item in a certain year.
So I've created a make table query for the first run. But what I want now, is an update query that says:
"WHERE MyTable!ItemName = MyCrosstab!ItemName AND MyTable!FieldName(Year) = MyCrosstab!FieldName(Year) UPDATE MyTable!Value to (MyTable!Value + MyCrosstab!Value)"
Can anyone help me with some proper SQL to do this?
Thanks,
Sarah %-)
I've got a real 'blue-sky' question here. This is what I want to do. I have a crosstab query with various items of furniture as the row headings, Years (2004, 2005 etc) as the column headings, and amounts of money as the values. SO you can see how much to spend on chairs in 2008, for instance.
For every project that is entered into the database, you would typically run this query once. All well and good. However, what I would like to do is store the costs in years against each item so that as the project database builds up, you can see ACROSS ALL PROJECTS (sorry for caps, thats the important bit), what you are going to spend on a certain item in a certain year.
So I've created a make table query for the first run. But what I want now, is an update query that says:
"WHERE MyTable!ItemName = MyCrosstab!ItemName AND MyTable!FieldName(Year) = MyCrosstab!FieldName(Year) UPDATE MyTable!Value to (MyTable!Value + MyCrosstab!Value)"
Can anyone help me with some proper SQL to do this?
Thanks,
Sarah %-)