S
scubadiver
SQL
SELECT E164src.MonthID, E164src.LiveMonth, E164src.Total AS [Current month],
(SELECT monthID from E164src AS temp WHERE temp.monthID=E164src.monthID-1) AS
Expr1
FROM E164src;
Eg data
MonthID Livemonth Current month Expr1
1 Aug 06 5
2 Sep 06 1 1
3 Oct 06 4 2
4 Nov 06 3 3
but what I really need is
MonthID Livemonth Current month New month
1 Aug 06 5
2 Sep 06 1 5
3 Oct 06 4 1
4 Nov 06 3 4
I cant think how to modify the SQL
thanks
SELECT E164src.MonthID, E164src.LiveMonth, E164src.Total AS [Current month],
(SELECT monthID from E164src AS temp WHERE temp.monthID=E164src.monthID-1) AS
Expr1
FROM E164src;
Eg data
MonthID Livemonth Current month Expr1
1 Aug 06 5
2 Sep 06 1 1
3 Oct 06 4 2
4 Nov 06 3 3
but what I really need is
MonthID Livemonth Current month New month
1 Aug 06 5
2 Sep 06 1 5
3 Oct 06 4 1
4 Nov 06 3 4
I cant think how to modify the SQL
thanks