S
SageOne
I have a table with muliple columns of data. In want to select all the data
with the exception of certain records that meet two criteria. I would like to
filter out all records in my table that simultaneouly have a spefic year in
one column "year = 2007" and a specific code in the another column "code =
volmkfrz". Please see my SQL below. Instead of filtering out all records
that meet both criteria, it is filtering out all records where year = 2007
regardless of code and all records with the code = volmkfrz regardless of
year. Please advise. All help is greatly appreciated.
SELECT [new holds 091508].Identifier, [new holds 091508].[Year Eff date],
[new holds 091508].BrokerId, [new holds 091508].BrokerName, [new holds
091508].IDXMemberId, [new holds 091508].CustomerName, [new holds
091508].HoldReasonCd, [new holds 091508].AmountCommission, [new holds
091508].MemberStateCd, [new holds 091508].TypeOfBusinessName, [new holds
091508].VendorTaxName, [new holds 091508].VendorId, [new holds
091508].CustomerId, [new holds 091508].DateEarned
FROM [new holds 091508]
WHERE ((([new holds 091508].[Year Eff date]) Not Like 2007) AND (([new holds
091508].HoldReasonCd) Not Like "volmkfrz"));
with the exception of certain records that meet two criteria. I would like to
filter out all records in my table that simultaneouly have a spefic year in
one column "year = 2007" and a specific code in the another column "code =
volmkfrz". Please see my SQL below. Instead of filtering out all records
that meet both criteria, it is filtering out all records where year = 2007
regardless of code and all records with the code = volmkfrz regardless of
year. Please advise. All help is greatly appreciated.
SELECT [new holds 091508].Identifier, [new holds 091508].[Year Eff date],
[new holds 091508].BrokerId, [new holds 091508].BrokerName, [new holds
091508].IDXMemberId, [new holds 091508].CustomerName, [new holds
091508].HoldReasonCd, [new holds 091508].AmountCommission, [new holds
091508].MemberStateCd, [new holds 091508].TypeOfBusinessName, [new holds
091508].VendorTaxName, [new holds 091508].VendorId, [new holds
091508].CustomerId, [new holds 091508].DateEarned
FROM [new holds 091508]
WHERE ((([new holds 091508].[Year Eff date]) Not Like 2007) AND (([new holds
091508].HoldReasonCd) Not Like "volmkfrz"));