0

I keep coming across this error message in certain queries and have found that if I move certain elements of the query (without changing anything else), it validates fine. My latest example is below.

The query throws the error message in this instance:

select distinct(email)
from contact
where email is not null
and account_number in (select account_number from Facebook_Total_Established)
and account_start_date > dateadd(d,-365,getdate())
and email not in (Select email from Facebook_LO01)
and email not in (Select email from Facebook_LO02)
and Trading_Terms = 'CASH'

But if I move the and account_number in (select account_number from Facebook_Total_Established) element to the end of the 'where', it will validate:

select distinct(email)
from contact
where email is not null
and account_start_date > dateadd(d,-365,getdate())
and email not in (Select email from Facebook_LO01)
and email not in (Select email from Facebook_LO02)
and Trading_Terms = 'CASH'
and account_number in (select account_number from Facebook_Total_Established)

I was just wondering if someone could explain to me why this is the case

  • Case raised with Salesforce: apparently this is a known bug and is on a list to be fixed – nc_analyst Mar 31 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.