Hi, I am trying to do a sql subselect using "not exists" within Crystal 8.5. I'm exporting the data out of our database using Access 2003 and then opening it up within Crystal 8.5 and would like to do a "not exists" subselect utilizing the following code: Is this possible?
SELECT
NF_EXECU.`Const ID`, NF_EXECU.`Fin Type`
FROM
`NF_EXECU` NF_EXECU
Where NOT EXISTS
(SELECT NF_EXECU2.`Const ID’
FROM`NF_EXECU` NF_EXECU2
WHERE NF_EXECU.`Const ID` = NF_EXECU2.`Const ID` AND NF_EXECU2.`Fin Type’ = ‘Senior Executives’)
ORDER BY
NF_EXECU.`Const ID` ASC
ODBC error: [Microsoft][ODBC Microsoft Access Driver]Syntax error in string in query expression 'NOT EXISTS (SELECT NF_EXECU2.'Const ID'
FROM 'NF_EXECU' NF_EXECU2
WHERE NF_EXECU'CONST ID' = NF_EXECU2.'CONST ID'
Any insight would be greatly appreciated. Thanks in advance.
SELECT
NF_EXECU.`Const ID`, NF_EXECU.`Fin Type`
FROM
`NF_EXECU` NF_EXECU
Where NOT EXISTS
(SELECT NF_EXECU2.`Const ID’
FROM`NF_EXECU` NF_EXECU2
WHERE NF_EXECU.`Const ID` = NF_EXECU2.`Const ID` AND NF_EXECU2.`Fin Type’ = ‘Senior Executives’)
ORDER BY
NF_EXECU.`Const ID` ASC
ODBC error: [Microsoft][ODBC Microsoft Access Driver]Syntax error in string in query expression 'NOT EXISTS (SELECT NF_EXECU2.'Const ID'
FROM 'NF_EXECU' NF_EXECU2
WHERE NF_EXECU'CONST ID' = NF_EXECU2.'CONST ID'
Any insight would be greatly appreciated. Thanks in advance.