CaiSupport
Technical User
I have the following working code to create a file with a price matching to the price file on Item number and price level. I now need to check for the price based on Customer number and item number besides Item number and Price Level. The pricing will be one or the other, but not both. This is my code.
strSQL = _
"SELECT #" & dteStart & "# AS Expr1, " & _
"CustomerService.[Customer Number], CustomerService.[Item Number], " & _
"IM1_InventoryMasterfile.ProductLine, " & _
"IM1_InventoryMasterfile.ItemDescription, " & _
"IMB_PriceCode.DiscountMarkupPriceRate1, CustomerService.[Price Level], " & _
"CustomerService.Quantity, IM1_InventoryMasterfile.TaxClass, " & _
"IM1_InventoryMasterfile.SalesUM, CustomerService.ID, " & _
"CustomerService.[Next Date], CustomerService.[Frequency] " & _
"FROM ((AR1_CustomerMaster RIGHT JOIN CustomerService " & _
"ON AR1_CustomerMaster.CustomerNumber=CustomerService.[Customer Number]) " & _
"INNER JOIN IMB_PriceCode " & _
"ON (CustomerService.[Price Level]=IMB_PriceCode.ItemCustomerPriceLevel) " & _
"AND (CustomerService.[Item Number]=IMB_PriceCode.ItemNumber)) " & _
"LEFT JOIN IM1_InventoryMasterfile " & _
"ON CustomerService.[Item Number] = IM1_InventoryMasterfile.ItemNumber " & _
"WHERE ((AR1_CustomerMaster.CustomerNumber <> "" "") AND " & strWHERE & ") " & _
"ORDER BY AR1_CustomerMaster.CustomerNumber, " & _
"IM1_InventoryMasterfile.ProductLine " & _
";"
It is the IMB_PriceCode file that I want to match on either customer/item or price level/item.
Thank you,
strSQL = _
"SELECT #" & dteStart & "# AS Expr1, " & _
"CustomerService.[Customer Number], CustomerService.[Item Number], " & _
"IM1_InventoryMasterfile.ProductLine, " & _
"IM1_InventoryMasterfile.ItemDescription, " & _
"IMB_PriceCode.DiscountMarkupPriceRate1, CustomerService.[Price Level], " & _
"CustomerService.Quantity, IM1_InventoryMasterfile.TaxClass, " & _
"IM1_InventoryMasterfile.SalesUM, CustomerService.ID, " & _
"CustomerService.[Next Date], CustomerService.[Frequency] " & _
"FROM ((AR1_CustomerMaster RIGHT JOIN CustomerService " & _
"ON AR1_CustomerMaster.CustomerNumber=CustomerService.[Customer Number]) " & _
"INNER JOIN IMB_PriceCode " & _
"ON (CustomerService.[Price Level]=IMB_PriceCode.ItemCustomerPriceLevel) " & _
"AND (CustomerService.[Item Number]=IMB_PriceCode.ItemNumber)) " & _
"LEFT JOIN IM1_InventoryMasterfile " & _
"ON CustomerService.[Item Number] = IM1_InventoryMasterfile.ItemNumber " & _
"WHERE ((AR1_CustomerMaster.CustomerNumber <> "" "") AND " & strWHERE & ") " & _
"ORDER BY AR1_CustomerMaster.CustomerNumber, " & _
"IM1_InventoryMasterfile.ProductLine " & _
";"
It is the IMB_PriceCode file that I want to match on either customer/item or price level/item.
Thank you,