I don't quite understand how to make a Procedure as most of my processing takes place in my scripts. I have a set of 3 Queries that are almost identical that I would like to combine them to return a result set.
The queries are:
SELECT Date, Location, Sum(SubTotal) FROM data WHERE (Date between 20121211 AND 20121231) and Account_Number like '%cash%' group by Location, Date order by Date;
SELECT Date, Location, Sum(SubTotal) FROM data WHERE (Date between 20121211 AND 20121231) AND Account_Number not like '%cash%' group by Location, Date order by Date;
SELECT Date, Location, Sum(SubTotal) FROM data WHERE (Date between 20121211 AND 20121231) group by Location, Date order by Date;
The basics are that I would like to sum up the cash sales, charge sales and provide a total.
Thanks for all your help