I'm no SQL expert but I've made a very simple query (copied below) that grabs qty and sales amounts for a specific date range for a specific vendor - what I'd like is a single query that compares that same date range from this year to last year.

SELECT
V.ItemCode,
V.ItemSupplierPartNum,
V.Description,
SUM(V.QtyShipped) As UnitsSold,
SUM(V.Amount) As DollarsSold
FROM vCustomerInvoiceDetail V
WHERE V.InvoiceDate between '2014-5-1' and '2014-5-31'
and V.SupplierAcct ='KRUGE100'
GROUP BY V.ItemCode, V.ItemSupplierPartNum, V.Description

I can use the UNION operator and build a query that gets all the data (copied below) but it just lays all the data out with double entries for items with sales in each date period. what I would like is for the query to generate columns with a single entry for the three main descpritors ItemCode, ItemSupplierPartNum, Description, plus seperate columns for QtyShipped (for 2014), Amount(for 2014), QtyShipped (for 2013), and Amount(for 2013)

SELECT
V.ItemCode,
V.ItemSupplierPartNum,
V.Description,
SUM(V.QtyShipped) As UnitsSold,
SUM(V.Amount) As DollarsSold
FROM vCustomerInvoiceDetail V
WHERE V.InvoiceDate between '2014-5-1' and '2014-5-31'
and V.SupplierAcct ='KRUGE100'
GROUP BY V.ItemCode, V.ItemSupplierPartNum, V.Description
UNION
SELECT
V.ItemCode,
V.ItemSupplierPartNum,
V.Description,
SUM(V.QtyShipped) As UnitsSold,
SUM(V.Amount) As DollarsSold
FROM vCustomerInvoiceDetail V
WHERE V.InvoiceDate between '2014-5-1' and '2014-5-31'
and V.SupplierAcct ='KRUGE100'
GROUP BY V.ItemCode, V.ItemSupplierPartNum, V.Description
ORDER BY V.ItemCode, V.ItemSupplierPartNum, V.Description


Any help is fully appreciated!!!