text + '[]' brackets as a result in parametric Query

E

Elsworth

Hello!

I wrote a parametric query (listed below). In field [S_Name] I place ex.
'Coal Boiler 1 [CB 1]'. Then the query returns zero records, but I know
that the records with 'Coal Boiler 1 [CB 1]' exists in database.
The problem is with '[]' brackets, becouse it works with paranthesis. Is
anyone know what to do to recive that records? I couldn't change '[]'
into '()'. Maybe anyone knows how to change eg.
[Forms]![frmSearch]![O_Name] into text in query?


SELECT tblWalkaround.DB_ID, tblWalkaround.C_Name, tblWalkaround.C_Date,
tblWalkaround.C_Time, tblWalkaround.M_Name, tblWalkaround.M_Date,
tblWalkaround.M_Time, tblWalkaround.F_Option, tblWalkaround.F_Date,
tblWalkaround.F_Mark, tblWalkaround.Description, tblObject.O_Name,
tblObject.O_SName, tblSystem.S_Name, tblElement.E_Name
FROM (tblObject INNER JOIN tblSystem ON tblObject.O_ID = tblSystem.O_ID)
INNER JOIN (tblElement INNER JOIN tblWalkaround ON tblElement.E_ID =
tblWalkaround.E_ID) ON tblSystem.S_ID = tblElement.S_ID
WHERE (((tblWalkaround.DB_ID)<>0) AND ((tblWalkaround.C_Date) Between
[Forms]![frmSearch]![frDate] And [Forms]![frmSearch]![toDate]) AND
((tblWalkaround.F_Option) Like [Forms]![frmSearch]![fOption]) AND
((tblWalkaround.F_Mark) Like [Forms]![frmSearch]![fMark]) AND
((tblObject.O_Name) Like [Forms]![frmSearch]![O_Name]) AND
((tblSystem.S_Name) Like [Forms]![frmSearch]![S_Name]) AND
((tblElement.E_Name) Like [Forms]![frmSearch]![E_Name]))
ORDER BY tblWalkaround.DB_ID;


TIA

Elsworth
 
E

Elsworth

Hello!

I found a solution that resolve that problem!
Query should look like that below:

SELECT tblWalkaround.DB_ID, tblWalkaround.C_Name, tblWalkaround.C_Date,
tblWalkaround.C_Time, tblWalkaround.M_Name, tblWalkaround.M_Date,
tblWalkaround.M_Time, tblWalkaround.F_Option, tblWalkaround.F_Date,
tblWalkaround.F_Mark, tblWalkaround.Description, tblObject.O_Name,
tblObject.O_SName, tblSystem.S_Name, tblElement.E_Name
FROM (tblObject INNER JOIN tblSystem ON tblObject.O_ID = tblSystem.O_ID)
INNER JOIN (tblElement INNER JOIN tblWalkaround ON tblElement.E_ID =
tblWalkaround.E_ID) ON tblSystem.S_ID = tblElement.S_ID
WHERE (((tblWalkaround.DB_ID)<>0) AND ((tblWalkaround.C_Date) Between
[Forms]![frmSearch]![frDate] And [Forms]![frmSearch]![toDate]) AND
((tblWalkaround.F_Option) Like [Forms]![frmSearch]![fOption]) AND
((tblWalkaround.F_Mark) Like [Forms]![frmSearch]![fMark]) AND
((tblObject.O_Name) Like [Forms]![frmSearch]![O_Name]) AND
((tblSystem.S_Name) Like [Forms]![frmSearch]![S_Name]) AND
((tblElement.E_Name) Like [Forms]![frmSearch]![E_Name])) OR
(((tblSystem.S_Name)=[Forms]![frmSearch]![S_Name]) AND
((tblElement.E_Name)=[Forms]![frmSearch]![E_Name]))
ORDER BY tblWalkaround.DB_ID;

Elsworth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top