Last active
October 6, 2017 14:51
-
-
Save JasonCrowe/9b24ba728d7291297c0c639746a159e8 to your computer and use it in GitHub Desktop.
Gist for product transfer from sql to airtable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT item.item, | |
qty AS inventory_level, | |
description, | |
product_code, | |
family_code, | |
plan_code, | |
unit_weight, | |
weight_units, | |
charfld1 AS upc, | |
stat, | |
RowPointer, | |
Uf_fourthCategory AS fourth_category, | |
Uf_LicenseeMark AS licensee_mark, | |
Uf_itemMaster_CountryOrigin AS country_origin, | |
Uf_Items_BaseSyle AS base_style, | |
Uf_Items_Size AS item_size | |
FROM item | |
JOIN ( | |
SELECT item, | |
SUM(qty_on_hand) AS qty | |
FROM dbo.itemwhse | |
WHERE qty_on_hand > 0 | |
GROUP BY item | |
) AS inv | |
ON inv.item = item.item | |
WHERE item.stat = 'a' | |
AND inv.qty > 0 | |
AND item.product_code NOT IN ('PKG-100', 'RAW-300', 'RAW-200', 'RAW-500', 'RAW-100') | |
AND item.family_code NOT IN ('RAW') | |
AND item.item NOT like ('%U-%') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment