Hi all,
I have what, on the face of it, is a very simply issue. I have one table (tblMain), which has 11 columns, the first being the data column and the rest of the columns (Field1 to Field 10) having numerical values. E.g.
Date Field1, Field2, Field3…….Field10
01/01/2011 100, 129, 78
02/01/2011 74, 25, 101
03/01/2011
04/01/2011
What I need to be able to do is to shift the values from Field1 and Field2 from the next row/day into Field9 and Field10 in the previous day. For example, if Field1 and Field2 on 02/01/2011 have values 74 and 25, I want to put these values into Field9 and Firld10 for the row 01/01/2011. Any ideas how to do this in SQL?
I’m doing this is Access SQL by the way but hopefully the solution will be generic.
Cheers,
Marck
I have what, on the face of it, is a very simply issue. I have one table (tblMain), which has 11 columns, the first being the data column and the rest of the columns (Field1 to Field 10) having numerical values. E.g.
Date Field1, Field2, Field3…….Field10
01/01/2011 100, 129, 78
02/01/2011 74, 25, 101
03/01/2011
04/01/2011
What I need to be able to do is to shift the values from Field1 and Field2 from the next row/day into Field9 and Field10 in the previous day. For example, if Field1 and Field2 on 02/01/2011 have values 74 and 25, I want to put these values into Field9 and Firld10 for the row 01/01/2011. Any ideas how to do this in SQL?
I’m doing this is Access SQL by the way but hopefully the solution will be generic.
Cheers,
Marck