Invalid bracketing of name error?

When trying to save the below query in Access the progam comes back and says:

Invalid bracketing of name 'SELECT DISTINCT(CALL_ID) FROM CCUSER_CALL_SUMMARY, CCADMIN_Agent_Shifts where (Call_begin between [Forms'.

Then it stops......maybe not enough space to complete the writing out of the error>

Anyhow the SQL we are trying to use is:

SELECT count (CALL_ID) AS ShiftCount
FROM [SELECT DISTINCT(CALL_ID)  FROM CCUSER_CALL_SUMMARY, CCADMIN_Agent_Shifts
WHERE (CALL_BEGIN Between [Forms]![Date Selection Form]![Date1] And [Forms]![Date Selection Form]![Date2] And
(MID(CCUSER_CALL_SUMMARY.CALL_BEGIN,9) BETWEEN CCADMIN_AGENT_SHIFTS.SHIFT_START AND CCADMIN_AGENT_SHIFTS.SHIFT_END) AND CCADMIN_Agent_shifts.shift =Reports![Call Detail Report]!txtShiftNum]. AS stalias;
MicroAutomationAsked:
Who is Participating?
 
LowfatspreadCommented:
try

SELECT count (CALL_ID) AS ShiftCount
FROM (SELECT DISTINCT(CALL_ID)  FROM CCUSER_CALL_SUMMARY, CCADMIN_Agent_Shifts
WHERE CALL_BEGIN Between [Forms]![Date Selection Form]![Date1] And [Forms]![Date Selection Form]![Date2]
 And MID(CCUSER_CALL_SUMMARY.CALL_BEGIN,9) BETWEEN CCADMIN_AGENT_SHIFTS.SHIFT_START AND CCADMIN_AGENT_SHIFTS.SHIFT_END
AND CCADMIN_Agent_shifts.shift =Reports![Call Detail Report]!txtShiftNum]) AS stalias;
0
 
awking00Commented:
You need an open parenthesis and not a bracket after the from keyword and a closing parenthesis a the end of the query.
0
 
MicroAutomationAuthor Commented:
Can you copy and post with correct syntax?
0
 
awking00Commented:
Just what I said, change the bracket ("[") after the FROM keyword to an open parenthesis ("(") and add the closing parenthesis at the end of the query -
...!txtShiftNum]) AS stalias;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.