Hello,
I have a search query to a single table and then goes to a form. My problem is that I use the Like "*" & [Forms]![csearch]![STEERING_PILOT] & "*" and it works great but when I add my other criterias so I can have 4 different search areas it returns either no results or randomized different set of records not even pertaining to the search.
Its like once I add two or more columns to search it acts weird. I am including the SQL code and also the LIKE commands I used for different columns.
Like "*" & [Forms]![csearch]![STEERING_PILOT] & "*"
Like "*" & [Forms]![csearch]![PILOT_NAME] & "*"
Like "*" & [Forms]![csearch]![INBOUND_SWITCH_TERMINATION] & "*"
Like "*" & [Forms]![csearch]![INBOUND_DIALED_NUMBER] & "*"
these commands once put in the criteria puts out the following sql in design mode (all spaces are correct and in this one I even tried putting it in 2 slots of criterias):
Can someone please help
I have a search query to a single table and then goes to a form. My problem is that I use the Like "*" & [Forms]![csearch]![STEERING_PILOT] & "*" and it works great but when I add my other criterias so I can have 4 different search areas it returns either no results or randomized different set of records not even pertaining to the search.
Its like once I add two or more columns to search it acts weird. I am including the SQL code and also the LIKE commands I used for different columns.
Like "*" & [Forms]![csearch]![STEERING_PILOT] & "*"
Like "*" & [Forms]![csearch]![PILOT_NAME] & "*"
Like "*" & [Forms]![csearch]![INBOUND_SWITCH_TERMINATION] & "*"
Like "*" & [Forms]![csearch]![INBOUND_DIALED_NUMBER] & "*"
these commands once put in the criteria puts out the following sql in design mode (all spaces are correct and in this one I even tried putting it in 2 slots of criterias):
Code:
SELECT [Call Flows].STEERING_PILOT, [Call Flows].INBOUND_DIALED_NUMBER, [Call Flows].INBOUND_SWITCH_TERMINATION, [Call Flows].PILOT_NAME, [Call Flows].OUTBOUND_DIALED_NUMBER, [Call Flows].NCG, [Call Flows].CG1, [Call Flows].CG2, [Call Flows].CG4, [Call Flows].[Mon-Fri], [Call Flows].[Sat-Sun], [Call Flows].[Mon-Sat], [Call Flows].[Mon-Sun], [Call Flows].Sat, [Call Flows].Sun
FROM [Call Flows] INNER JOIN ACDC ON [Call Flows].ID = ACDC.ID
WHERE ((([Call Flows].STEERING_PILOT) Like "*" & [Forms]![csearch]![STEERING_PILOT] & "*") AND (([Call Flows].INBOUND_DIALED_NUMBER) Like "*" & [Forms]![csearch]![INBOUND_DIALED_NUMBER] & "*") AND (([Call Flows].INBOUND_SWITCH_TERMINATION) Like "*" & [Forms]![csearch]![INBOUND_SWITCH_TERMINATION] & "*") AND (([Call Flows].PILOT_NAME) Like "*" & [Forms]![csearch]![PILOT_NAME] & "*")) OR ((([Call Flows].STEERING_PILOT) Like "*" & [Forms]![csearch]![STEERING_PILOT] & "*") AND (([Call Flows].INBOUND_DIALED_NUMBER) Like "*" & [Forms]![csearch]![INBOUND_DIALED_NUMBER] & "*") AND (([Call Flows].INBOUND_SWITCH_TERMINATION) Like "*" & [Forms]![csearch]![INBOUND_SWITCH_TERMINATION] & "*") AND (([Call Flows].PILOT_NAME) Like "*" & [Forms]![csearch]![PILOT_NAME] & "*"));
Can someone please help