Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL reporting Services

Author  Topic 

Rweath15
Starting Member

2 Posts

Posted - 2012-01-06 : 09:22:29
Hello, I am getting a syntax error when I use the listed querie...Can anybody see what my issue is???

SELECT dbo.TableOfDates.fld_date, incidentsm1.incident_id, incidentsm1.open_time, incidentsm1.close_time, incidentsm1.incident_linked, incidentsm1.call_source, incidentsm1.closed_by, operatorm1.full_name
FROM dbo.TableOfDates WITH (NOLOCK)
JOIN operatorm1 ON incidentsm1.closed_by=operatorm1.full_name
(SELECT incident_id, open_time, close_time, incident_linked, call_source, closed_by, full_name
FROM dbo.incidentsm1 WITH (NOLOCK)
WHERE (open_time BETWEEN (@StartDate) AND DATEADD(dd, 1, @EndDate))
AND (assignment_group LIKE '1 ITSO SER%')
AND incidentsm1.call_source IN (@CallSource)
AND (assignee_name = (@TechID) OR (@TechID) IS NULL))
AS incidentsm1 ON CONVERT(varchar(10), incidentsm1.open_time, 112) = CONVERT(varchar(10), dbo.TableOfDates.fld_date, 112)
WHERE (dbo.TableOfDates.fld_date BETWEEN (@StartDate) AND @EndDate)

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-01-06 : 09:25:14
This?
quote:
Originally posted by Rweath15

Hello, I am getting a syntax error when I use the listed querie...Can anybody see what my issue is???

SELECT dbo.TableOfDates.fld_date, incidentsm1.incident_id, incidentsm1.open_time, incidentsm1.close_time, incidentsm1.incident_linked, incidentsm1.call_source, incidentsm1.closed_by, operatorm1.full_name
FROM dbo.TableOfDates WITH (NOLOCK)
JOIN operatorm1 ON incidentsm1.closed_by=operatorm1.full_name

JOIN

(SELECT incident_id, open_time, close_time, incident_linked, call_source, closed_by, full_name
FROM dbo.incidentsm1 WITH (NOLOCK)
WHERE (open_time BETWEEN (@StartDate) AND DATEADD(dd, 1, @EndDate))
AND (assignment_group LIKE '1 ITSO SER%')
AND incidentsm1.call_source IN (@CallSource)
AND (assignee_name = (@TechID) OR (@TechID) IS NULL))
AS incidentsm1 ON CONVERT(varchar(10), incidentsm1.open_time, 112) = CONVERT(varchar(10), dbo.TableOfDates.fld_date, 112)
WHERE (dbo.TableOfDates.fld_date BETWEEN (@StartDate) AND @EndDate)




No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Rweath15
Starting Member

2 Posts

Posted - 2012-01-06 : 09:48:06
I tried that and no longer get the syntax error..but now i get...
The multi-part identifier "incidentsm1.closed_by could not be bound"
The multi-part identifier "operatorm1.full_name could not be bound"
Go to Top of Page
   

- Advertisement -