B
bcasper
Here's a shortened version of my current SQL statement:
SELECT IMAGING_FOLDER_T.ICN
FROM IMAGING_BATCH_T INNER JOIN IMAGING_FOLDER_T ON
IMAGING_BATCH_T.BATCH_NM = IMAGING_FOLDER_T.BATCH_NM
GROUP BY IMAGING_FOLDER_T.ICN
HAVING (((IMAGING_FOLDER_T.ICN) Like [Enter the Julian
date:] And (IMAGING_FOLDER_T.ICN) Like "?????")); Here's
what I want the SQL to do: SELECT
[Contact/Division].Contract, IMAGING_FOLDER_T.ICN
FROM (IMAGING_BATCH_T INNER JOIN IMAGING_FOLDER_T ON
IMAGING_BATCH_T.BATCH_NM = IMAGING_FOLDER_T.BATCH_NM)
INNER JOIN [Contact/Division] ON
IMAGING_BATCH_T.PROCESS_NM = [Contact/Division].Process_NM
GROUP BY [Contact/Division].Contract, IMAGING_FOLDER_T.ICN
HAVING ((([Contact/Division].Contract)=[Enter the
contract:]) AND ((IMAGING_FOLDER_T.ICN)=IIf([Contract]
="Medicare",(IMAGING_FOLDER_T.ICN) Like "??" & [Enter the
Medicare Julian Date] & "??????",(IMAGING_FOLDER_T.ICN)
Like [Enter the Julian date:] & "?????"))); What I am
trying to do is if the user enters a certain value for the
contract field, it will can what the criteria is of the
ICN field but the IIf statement in the ICN criteria keeps
defaulting to true even when it shouldn't. Please help.
SELECT IMAGING_FOLDER_T.ICN
FROM IMAGING_BATCH_T INNER JOIN IMAGING_FOLDER_T ON
IMAGING_BATCH_T.BATCH_NM = IMAGING_FOLDER_T.BATCH_NM
GROUP BY IMAGING_FOLDER_T.ICN
HAVING (((IMAGING_FOLDER_T.ICN) Like [Enter the Julian
date:] And (IMAGING_FOLDER_T.ICN) Like "?????")); Here's
what I want the SQL to do: SELECT
[Contact/Division].Contract, IMAGING_FOLDER_T.ICN
FROM (IMAGING_BATCH_T INNER JOIN IMAGING_FOLDER_T ON
IMAGING_BATCH_T.BATCH_NM = IMAGING_FOLDER_T.BATCH_NM)
INNER JOIN [Contact/Division] ON
IMAGING_BATCH_T.PROCESS_NM = [Contact/Division].Process_NM
GROUP BY [Contact/Division].Contract, IMAGING_FOLDER_T.ICN
HAVING ((([Contact/Division].Contract)=[Enter the
contract:]) AND ((IMAGING_FOLDER_T.ICN)=IIf([Contract]
="Medicare",(IMAGING_FOLDER_T.ICN) Like "??" & [Enter the
Medicare Julian Date] & "??????",(IMAGING_FOLDER_T.ICN)
Like [Enter the Julian date:] & "?????"))); What I am
trying to do is if the user enters a certain value for the
contract field, it will can what the criteria is of the
ICN field but the IIf statement in the ICN criteria keeps
defaulting to true even when it shouldn't. Please help.