MkIIISupra
Programmer
Hello all!
I have an Access DB that is using several Oracle tables to query against for some in-house reports. The table that I am using as a criteria selector has 3 non-changeable (data content cannot be modified by the user) drop menus that are used to allow the user the ability to select 3 items for their contract.
tblContractSelction
SITE_NAME : drop menu / VISIBLE TO USER
PHASE_NAME : drop menu / VISIBLE TO USER
ENTRYTEXT : drop menu / VISIBLE TO USER
ENTRYTEXT2 : Populated by case statement that is driven by ENTRYTEXT / NOT VISIBLE TO USER
How the form works is the user will select each item needed as follows:
Select SITE_NAME from SITE_NAME menu – identifies the contract site needed
Select PHASE_NAME from PHASE_NAME menu – identifies the appropriate phase of the selected SITE_NAME
Select ENTRYTEXT from ENTRYTEXT menu – afterUpdate will take selection and create a Like statement to be used in the query below.
Once all 3 criteria are selected then a function button executes the query which is tied to this table for variable input. Problem is I cannot seem to get the Like statement to work. What I am trying to do is a first line Like match on the FIELD ENTRYTEXT in the Oracle DB, but I get a NULL return with all the combinations I have tried. The area that is bolded in the SQL code below is the area I am having an issue with. I have tried several combinations and none have resulted in a return. Below the code are some examples of the other code I have tried so far.
Example:
Like “[tblContractSelector]![ENTRYTEXT2]*”
Like “*[tblContractSelector]![ENTRYTEXT2]”
Like “*[tblContractSelector]![ENTRYTEXT2]*”
So how do I set up an Access query using a table to give selection criteria that can be used with a Like switch?
One by one the penguins steal my sanity!
I have an Access DB that is using several Oracle tables to query against for some in-house reports. The table that I am using as a criteria selector has 3 non-changeable (data content cannot be modified by the user) drop menus that are used to allow the user the ability to select 3 items for their contract.
tblContractSelction
SITE_NAME : drop menu / VISIBLE TO USER
PHASE_NAME : drop menu / VISIBLE TO USER
ENTRYTEXT : drop menu / VISIBLE TO USER
ENTRYTEXT2 : Populated by case statement that is driven by ENTRYTEXT / NOT VISIBLE TO USER
How the form works is the user will select each item needed as follows:
Select SITE_NAME from SITE_NAME menu – identifies the contract site needed
Select PHASE_NAME from PHASE_NAME menu – identifies the appropriate phase of the selected SITE_NAME
Select ENTRYTEXT from ENTRYTEXT menu – afterUpdate will take selection and create a Like statement to be used in the query below.
Once all 3 criteria are selected then a function button executes the query which is tied to this table for variable input. Problem is I cannot seem to get the Like statement to work. What I am trying to do is a first line Like match on the FIELD ENTRYTEXT in the Oracle DB, but I get a NULL return with all the combinations I have tried. The area that is bolded in the SQL code below is the area I am having an issue with. I have tried several combinations and none have resulted in a return. Below the code are some examples of the other code I have tried so far.
Code:
SELECT
CMPS_CDS_SITE_CALL_LOG.TRACKER,
CMPS_CDS_SITE_CALL_LOG.CALLDESC,
CMPS_CDS_SITE_CALL_LOG.RECVDDATE,
CMPS_CPM_ENROLLMENT_SITE.SITE_NAME,
CMPS_CPM_ENROLLMENT_SITE.SITE_NBR,
CMPS_CDS_SITE_CALL_JOURNAL.ENTRYTEXT,
CMPS_CDS_SITE_CALL_LOG.CALLSTATUS,
CMPS_CDS_SITE_CALL_LOG.SHORTDESC,
CMPS_CPM_PHASE.PHASE_NAME,
CMPS_CDS_SITE_CALL_LOG.CAUSE
FROM
CMPS_CPM_ENROLLMENT_SITE INNER JOIN CMPS_CPM_PHASE ON CMPS_CPM_ENROLLMENT_SITE.PHASE_SYS_ID = CMPS_CPM_PHASE.PHASE_SYS_ID,
tblContractSelector INNER JOIN (CMPS_CDS_SITE_CALL_JOURNAL INNER JOIN CMPS_CDS_SITE_CALL_LOG ON CMPS_CDS_SITE_CALL_JOURNAL.CALLID = CMPS_CDS_SITE_CALL_LOG.CALLID) ON tblContractSelector.CALLSTATUS = CMPS_CDS_SITE_CALL_LOG.CALLSTATUS
WHERE
(((CMPS_CPM_ENROLLMENT_SITE.SITE_NAME)=[tblContractSelector]![SITE_NAME]) AND
((CMPS_CDS_SITE_CALL_JOURNAL.ENTRYTEXT) [B]Like [tblContractSelector]![ENTRYTEXT2][/B]) AND ((CMPS_CDS_SITE_CALL_LOG.CALLSTATUS)="OPEN") AND
((CMPS_CPM_PHASE.PHASE_NAME)=[tblContractSelector]![PHASE_NAME]) AND
((CMPS_CDS_SITE_CALL_LOG.CAUSE)="ACCOUNTABILITY"));
Example:
Like “[tblContractSelector]![ENTRYTEXT2]*”
Like “*[tblContractSelector]![ENTRYTEXT2]”
Like “*[tblContractSelector]![ENTRYTEXT2]*”
So how do I set up an Access query using a table to give selection criteria that can be used with a Like switch?
One by one the penguins steal my sanity!