here is my SQL Query which works fine. But to it I need to add records in which applic.`appl_stat` = 'SU0' and applic.`casemangr` = '000'
//original query
SELECT
applic.`idnumber`,
applic.`appl_stat`,
applic.`casemangr`,
refer.`idnumber`,
refer.`proj_from`,
refer.`answer`,
refer.proj_from + refer.answer
FROM
`applic` applic LEFT OUTER JOIN `refer` refer ON applic.`idnumber` = refer.`idnumber`
WHERE
applic.`appl_stat` = 'EN'
and
refer.`idnumber` NOT IN (SELECT refer.`idnumber` FROM `refer` refer WHERE refer.`proj_from` = '018601' AND refer.`answer` = 'T')
ORDER BY
applic.`idnumber` ASC
//this is the new query which crashed crystal when i run it
SELECT
applic.`idnumber`,
applic.`appl_stat`,
applic.`casemangr`,
refer.`idnumber`,
refer.`proj_from`,
refer.`answer`,
applic.appl_stat + applic.casemangr
FROM
`applic` applic LEFT OUTER JOIN `refer` refer ON applic.`idnumber` = refer.`idnumber`
WHERE
applic.`appl_stat` = 'EN'
and
refer.`idnumber` NOT IN (SELECT refer.`idnumber` FROM `refer` refer WHERE refer.`proj_from` = '018601' AND refer.`answer` = 'T')
or
applic.`appl_stat` = 'SU0' and applic.`casemangr` = '000'
ORDER BY
applic.`idnumber` ASC
I also tried making an expression for
or
applic.appl_stat + applic.casemangr = 'SU0000' but that gave an error of Invalid Key Length?
any suggestions?
thanks
//original query
SELECT
applic.`idnumber`,
applic.`appl_stat`,
applic.`casemangr`,
refer.`idnumber`,
refer.`proj_from`,
refer.`answer`,
refer.proj_from + refer.answer
FROM
`applic` applic LEFT OUTER JOIN `refer` refer ON applic.`idnumber` = refer.`idnumber`
WHERE
applic.`appl_stat` = 'EN'
and
refer.`idnumber` NOT IN (SELECT refer.`idnumber` FROM `refer` refer WHERE refer.`proj_from` = '018601' AND refer.`answer` = 'T')
ORDER BY
applic.`idnumber` ASC
//this is the new query which crashed crystal when i run it
SELECT
applic.`idnumber`,
applic.`appl_stat`,
applic.`casemangr`,
refer.`idnumber`,
refer.`proj_from`,
refer.`answer`,
applic.appl_stat + applic.casemangr
FROM
`applic` applic LEFT OUTER JOIN `refer` refer ON applic.`idnumber` = refer.`idnumber`
WHERE
applic.`appl_stat` = 'EN'
and
refer.`idnumber` NOT IN (SELECT refer.`idnumber` FROM `refer` refer WHERE refer.`proj_from` = '018601' AND refer.`answer` = 'T')
or
applic.`appl_stat` = 'SU0' and applic.`casemangr` = '000'
ORDER BY
applic.`idnumber` ASC
I also tried making an expression for
or
applic.appl_stat + applic.casemangr = 'SU0000' but that gave an error of Invalid Key Length?
any suggestions?
thanks