Hello
I am currently writing a view in sql server using the front end view building tool and I am trying to within the criteria use the 'IN' Statement which then does a sub query as follows 'IN (SELECT TOP 1 DATE FROM CUSTOMER MA WHERE DATE >'12/05/2006' AND CUSTOMERCODE = MA.CUSTOMER CODE). It is basically needs to join on its self but it keeps bring an error of :
'The column prefix 'MA' does not match with a table or alias name used in the query'
Can anyone help?
I am currently writing a view in sql server using the front end view building tool and I am trying to within the criteria use the 'IN' Statement which then does a sub query as follows 'IN (SELECT TOP 1 DATE FROM CUSTOMER MA WHERE DATE >'12/05/2006' AND CUSTOMERCODE = MA.CUSTOMER CODE). It is basically needs to join on its self but it keeps bring an error of :
'The column prefix 'MA' does not match with a table or alias name used in the query'
Can anyone help?