ietprofessional
Programmer
Here is an example of the table I'm querying and secondly how I want it to be displayed in a form.
1) Initial Table: (this is one row)
sales rep - company name - date - novunit - novasp - decunit - decasp
Notice that the november and december units are in one record.
2) Why I want a union: (this is two rows)
sales rep - company name - date - novunit - novasp
sales rep - company name - date - decunit - decasp
Notice that the november and december units are in separate records. I'm having trouble accomplishing this.
How I'm trying to accomplish the union:
THANKS!
1) Initial Table: (this is one row)
sales rep - company name - date - novunit - novasp - decunit - decasp
Notice that the november and december units are in one record.
2) Why I want a union: (this is two rows)
sales rep - company name - date - novunit - novasp
sales rep - company name - date - decunit - decasp
Notice that the november and december units are in separate records. I'm having trouble accomplishing this.
How I'm trying to accomplish the union:
Code:
SELECT unitsandasp.salesrep as one, unitsandasp.companyname as two, unitsandasp.date as three, unitsandasp.product as four, unitsandasp.novunits as five, unitsandasp.novasp as six
FROM unitsandasp
union
SELECT unitsandasp.salesrep as one, unitsandasp.companyname as two, unitsandasp.date as three, unitsandasp.product as four, unitsandasp.decunits as five, unitsandasp.decasp as six
FROM unitsandasp;
THANKS!