I have a field called drvQty and a field posType. If posType is "CusShip", the drvQty refers to the quantity of customer shipments. If posType is "IC", then drvQty refers to the quantity of Inter Company shipments. If neither of these are true, drvQty refers to OpenShippers. I want to write a query that will declare drvQty AS CusShipQuantity and drvQty AS ICQty and drvQty AS OpenShip depending on the posType field.
This is what I have, and it doesnt work:
SELECT tblDrive.drvPosType, iif(tblDrive.drvPosType="CusShip", tblDrive.drvQty AS CusShip, iif(tblDrive.PosType="IC", tblDrive.drvQty AS IC, tblDrive.drvQty AS OpenShip))
FROM tblDrive
Thank you for any advice.
This is what I have, and it doesnt work:
SELECT tblDrive.drvPosType, iif(tblDrive.drvPosType="CusShip", tblDrive.drvQty AS CusShip, iif(tblDrive.PosType="IC", tblDrive.drvQty AS IC, tblDrive.drvQty AS OpenShip))
FROM tblDrive
Thank you for any advice.