I have a table with some fields. break_mon, lunch_mon, dinner_mon, ent_mon,
break_tue, lunch_tue, dinner_tue, ent_tue, .....etc
I want to output the sum of the four monday columns as well as the sum of
the four tuesday columns.
I did this with
SELECT break_mon+lunch _mon+dinner_mon +ent_mon AS mon_tot,
break_tue+lunch _tue+dinner_tue +ent_tue AS tue_tot
FROM expense_report
I now want to add mon_tot and tue_tot AS total, but SQL is telling me that
it can not find mon_tot. Is there a way to do this? Thanks!
Darren
MCP
break_tue, lunch_tue, dinner_tue, ent_tue, .....etc
I want to output the sum of the four monday columns as well as the sum of
the four tuesday columns.
I did this with
SELECT break_mon+lunch _mon+dinner_mon +ent_mon AS mon_tot,
break_tue+lunch _tue+dinner_tue +ent_tue AS tue_tot
FROM expense_report
I now want to add mon_tot and tue_tot AS total, but SQL is telling me that
it can not find mon_tot. Is there a way to do this? Thanks!
Darren
MCP
Comment