How to Filter values in where clause alias variable,
CREATE TABLE BASE_Chq
(
ChequeInvoicePaymentId BIGINT NULL,
ChequeNumber VARCHAR(45) NOT NULL,
Amount MONEY NOT NULL
)
Once i select the whole table value i'm getting the result like below,
SELECT IIf(ChequeInvoicePaymentId IS NULL, 'OWN', 'PARTY') AS ChequeType, ChequeNumber, Amount
BASE_Chq
i want to filter Cheque Type wise but i'm getting error,
ERROR CODE:
SELECT IIf(ChequeInvoicePaymentId IS NULL, 'OWN', 'PARTY') AS ChequeType, ChequeNumber, Amount
FROM BASE_Chq
WHERE (ChequeType = 'PARTY')
How to search using alias column in where clause?