Forum Discussion
APandya
Aug 09, 2022Copper Contributor
Access Query
Folks... I don't know whether I can submit question here but would appreciate if anyone would help. I have a data as below: Id Account Type Buy_Quantity Sell_Quantity 1001 A 5 0 100...
APandya
Copper Contributor
Thanks George. Unfortunately, I’m relying on source data so it is hard for me to change the structure but thanks for your valuable input.
George_Hepworth
Aug 10, 2022Silver Contributor
In that case, use the original SQL I proposed, modifying table and field names.
SELECT [ID], [Buy_Quantity], [Sell_Quantity], Iif([Buy_Quantity]>[Sell_Quantity],"A","B") AS [Account_Type]
FROM tblYourTableNameGoesHere
SELECT [ID], [Buy_Quantity], [Sell_Quantity], Iif([Buy_Quantity]>[Sell_Quantity],"A","B") AS [Account_Type]
FROM tblYourTableNameGoesHere