![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am a novice at SQL and cannot figure out an effective way to export a product file that only has products over 25% margin. SELECT p.ProductCode AS 'Mfr Part Number' , p.ProductName AS 'Title' , pd.ProductDescriptionShort AS [stripHTML-Description] , pe.ProductManufacturer AS 'Brand' , pe.UPC_code AS 'UPC' , pe.ProductPrice AS 'Price' , pe.ProductWeight AS 'Shipping Weight' , 'Config_FullStoreURLProductDetails.asp?ProductCode =' + p.ProductCode + '&click=53249' AS 'Link' , 'Config_FullStoreURLConfig_ProductPhotosFolder/' + p.ProductCode + '-2.jpg' AS 'Image' FROM Products p INNER JOIN Products_Descriptions pd ON p.ProductID = pd.ProductID INNER JOIN Products_Extended pe ON pd.ProductID = pe.ProductID WHERE (p.IsChildOfProductCode is NULL OR p.IsChildOfProductCode = '') AND (p.HideProduct is NULL OR p.HideProduct <> 'Y') AND (pe.ProductPrice > 0 AND pe.ProductPrice IS NOT NULL) AND (SUM(pe.Vendor_Price/pe.ProductPrice) > '.25') ORDER BY p.ProductCode |
![]() |
| Thread Tools | |
| Display Modes | |
| |