Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

For all of you SQL gurus out there!

$
0
0

I have been racking my brains out over the thanksgiving holiday an have had no luck in doing the following.

I run the following SQL script to get the last twelve months of data from our sales database. While this has returned every sale as I had wanted for another report it has been asked of me to now search the results and find out if the product has been ordered before and if not to return the results to another report.

Here is what I have got so far:

SELECT cicmpy.cmp_name AS"Company Name", humres.fullname AS"Salesperson", oehdrhst_sql.ord_dt AS"Order Date", oelinhst_sql.item_no AS"Item Number", oelinhst_sql.item_desc_1 AS"Description", oelinhst_sql.qty_ordered AS"Qty Ordered", oelinhst_sql.item_desc_2 AS"UPC CODE", oehdrhst_sql.oe_po_no AS"Customer PO"FROM(humres humres INNERJOIN(cicmpy cicmpy INNERJOIN oehdrhst_sql...

Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>