Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Error

Status
Not open for further replies.

nwalk81

Technical User
Sep 30, 2003
29
US
Hello All,

Can someone please help, I can not figure out this error and I can not move forward in my project until I do
Code:
(((Resolution.Date)>=[Forms]![Closed Issues Report Options]![cmbBeginDate] AND (Resolution.Date)<=[Forms]![Closed Issues Report Options]![cmbEndDate]) AND ((EmpInfo.[VZW Area Code])=[Forms]![Closed Issues Report Options]![cmbArea]) And ((tmpEmpOnLeave.[Location Descr])=[Forms]![Closed Issues Report Options]![cmbLoc])

Thank you for you assistance!
 
What is the error message?
Why not post the whole query.
 
The error just says syntax error in query expression with an emphasis on the code above. I didn't post the whole thing because it is large, but you asked for it so
Code:
SELECT Resolution.Date, EmpInfo.[VZW Area Code], tmpEmpOnLeave.[Location Descr], Resolution.[Resolution Type Lookup], EmpInfo.HRAnalystID, EmpInfo.[First Name], EmpInfo.Last, EmpInfo.[Job Title], DateDiff('y',EmpInfo.[Service Dt],[Claim Info].[Last Date]) AS Tenure, DateDiff('y',[Claim Info].[Last Date],[Resolution].[Date]) AS [Days Absent]
FROM ((tmpEmpOnLeave INNER JOIN EmpInfo ON tmpEmpOnLeave.ID = EmpInfo.ID) INNER JOIN [Claim Info] ON tmpEmpOnLeave.[Claim Code] = [Claim Info].[Claim Code]) INNER JOIN Resolution ON [Claim Info].[Claim Code] = Resolution.[Claim ID]
WHERE (((Resolution.Date)>=[Forms]![Closed Issues Report Options]![cmbBeginDate]) AND ((Resolution.Date)<=[Forms]![Closed Issues Report Options]![cmbEndDate]) AND ((EmpInfo.[VZW Area Code])=[Forms]![Closed Issues Report Options]![cmbArea]) And ((tmpEmpOnLeave.[Location Descr])=[Forms]![Closed Issues Report Options]![cmbLoc]) AND ((Resolution.[Resolution Type Lookup])=[Forms]![Closed Issues Report Options]![cmdResolutionType])) OR (((Resolution.Date)>=[Forms]![Closed Issues Report Options]![cmbBeginDate] AND (Resolution.Date)<=[Forms]![Closed Issues Report Options]![cmbEndDate]) AND (([tmpEmpOnLeave].[Location Descr])=[Forms]![Closed Issues Report Options]![cmbLoc]) AND ((Resolution.[Resolution Type Lookup])=[Forms]![Closed Issues Report Options]![cmdResolutionType]) AND (([EmpInfo].[VZW Area Code])=[Forms]![Closed Issues Report Options]![cmbArea]) Is Null) OR (((Resolution.Date)>=[Forms]![Closed Issues Report Options]![cmbBeginDate] AND (Resolution.Date)<=[Forms]![Closed Issues Report Options]![cmbEndDate]) AND ((EmpInfo.[VZW Area Code])=[Forms]![Closed Issues Report Options]![cmbArea]) AND ((Resolution.[Resolution Type Lookup])=[Forms]![Closed Issues Report Options]![cmdResolutionType]) AND ((([tmpEmpOnLeave].[Location Descr])=[Forms]![Closed Issues Report Options]![cmbLoc]) Is Null)) OR (((Resolution.Date)>=[Forms]![Closed Issues Report Options]![cmbBeginDate] AND (Resolution.Date)<=[Forms]![Closed Issues Report Options]![cmbEndDate]) AND ((EmpInfo.[VZW Area Code])=[Forms]![Closed Issues Report Options]![cmbArea]) AND ((tmpEmpOnLeave.[Location Descr])=[Forms]![Closed Issues Report Options]![cmbLoc]) AND ((([Resolution].[Resolution Type Lookup])=[Forms]![Closed Issues Report Options]![cmdResolutionType]) Is Null)) OR (((Resolution.Date)>=[Forms]![Closed Issues Report Options]![cmbBeginDate] AND (Resolution.Date)<=[Forms]![Closed Issues Report Options]![cmbEndDate]) AND ((([EmpInfo].[VZW Area Code])=[Forms]![Closed Issues Report Options]![cmbArea]) Is Null) AND ((([tmpEmpOnLeave].[Location Descr])=[Forms]![Closed Issues Report Options]![cmbLoc]) Is Null) AND ((([Resolution].[Resolution Type Lookup])=[Forms]![Closed Issues Report Options]![cmdResolutionType]) Is Null) OR (((Resolution.Date)>=[Forms]![Closed Issues Report Options]![cmbBeginDate] AND (Resolution.Date)<=[Forms]![Closed Issues Report Options]![cmbEndDate]) AND ((([EmpInfo].[VZW Area Code])=[Forms]![Closed Issues Report Options]![cmbArea]) Is Null) AND ((([tmpEmpOnLeave].[Location Descr])=[Forms]![Closed Issues Report Options]![cmbLoc]) Is Null) AND ((([Resolution].[Resolution Type Lookup])=[Forms]![Closed Issues Report Options]![cmdResolutionType])  OR (((Resolution.Date)>=[Forms]![Closed Issues Report Options]![cmbBeginDate] AND (Resolution.Date)<=[Forms]![Closed Issues Report Options]![cmbEndDate]) AND ((([EmpInfo].[VZW Area Code])=[Forms]![Closed Issues Report Options]![cmbArea]) Is Null) AND ((([tmpEmpOnLeave].[Location Descr])=[Forms]![Closed Issues Report Options]![cmbLoc]) AND ((([Resolution].[Resolution Type Lookup])=[Forms]![Closed Issues Report Options]![cmdResolutionType]) Is Null) OR (((Resolution.Date)>=[Forms]![Closed Issues Report Options]![cmbBeginDate] AND (Resolution.Date)<=[Forms]![Closed Issues Report Options]![cmbEndDate]) AND ((([EmpInfo].[VZW Area Code])=[Forms]![Closed Issues Report Options]![cmbArea]) AND ((([tmpEmpOnLeave].[Location Descr])=[Forms]![Closed Issues Report Options]![cmbLoc]) Is Null) AND ((([Resolution].[Resolution Type Lookup])=[Forms]![Closed Issues Report Options]![cmdResolutionType]) Is Null));

Thanks for replying
 
Well, the initial post might be layed out like this
Code:
(
  (
    (Resolution.Date) >= [Forms]![Closed Issues Report Options]![cmbBeginDate]
    AND
    (Resolution.Date) <= [Forms]![Closed Issues Report Options]![cmbEndDate]
  )
  AND
  (
    (EmpInfo.[VZW Area Code]) = [Forms]![Closed Issues Report Options]![cmbArea]
  )
  And
  (
    (tmpEmpOnLeave.[Location Descr]) = [Forms]![Closed Issues Report Options]![cmbLoc]
  )
which suggests the problem is unbalanced parentheses.


But that may not be the whole problem.
Code:
(
  (
    (Resolution.Date) >= [Forms]![Closed Issues Report Options]![cmbBeginDate]
    AND
    (Resolution.Date) <= [Forms]![Closed Issues Report Options]![cmbEndDate]
  )
  AND
  (
    (
      ([EmpInfo].[VZW Area Code])=[Forms]![Closed Issues Report Options]![cmbArea]
    )
    AND
    (
      (
        ([tmpEmpOnLeave].[Location Descr])=[Forms]![Closed Issues Report Options]![cmbLoc]
       ) Is Null
    )
    AND
    (
      (
        ([Resolution].[Resolution Type Lookup])=[Forms]![Closed Issues Report Options]![cmdResolutionType]
      ) Is Null
    )
  );

It appears there is still an unbalanced paren.

But I am wondering about the two pieces like this
Code:
    AND
    (
      (
        ([Resolution].[Resolution Type Lookup])=[Forms]![Closed Issues Report Options]![cmdResolutionType]
      ) Is Null
    )

What does it mean to say that column equals value is null?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top