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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Inner Join

Author  Topic 

whitmoj
Yak Posting Veteran

68 Posts

Posted - 2008-10-03 : 04:13:46
I have got a couple of tables I am trying to join but having no luck. I have joined many tables in this way and never had this error. Here is my code

SELECT
App. Siteid,
Paw. AP_LOG_DATE,
App. Appl,
Paw. AP_CALLS_OFFRD,
Paw. AP_IN_CALLS_HNDLD,
Paw. AP_CALLS_ABND_00,
Paw. AP_CALLS_HNDLD_00,
Paw. AP_CALLS_HNDLD_05,
Paw. AP_CALLS_HNDLD_10,
Paw. AP_CALLS_HNDLD_15,
Paw. AP_CALLS_HNDLD_20,
Paw. AP_CALLS_HNDLD_25

FROM dbo.PER_APPL_WYTH AS Paw

INNER JOIN dbo.Application Config AS AP ON Paw AP_APPL = AP Appl

WHERE Paw. AP_LOG_DATE BETWEEN '2008-09-01 00:00:00' AND '2008-09-04 00:00:00'
AND App. Siteid = 'GCLW'

My Error reads
Incorrect syntax near the keyword 'AS'. (in Red)

Any help would be great

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-03 : 04:25:27
quote:
Originally posted by whitmoj

I have got a couple of tables I am trying to join but having no luck. I have joined many tables in this way and never had this error. Here is my code

SELECT
App. Siteid,
Paw. AP_LOG_DATE,
App. Appl,
Paw. AP_CALLS_OFFRD,
Paw. AP_IN_CALLS_HNDLD,
Paw. AP_CALLS_ABND_00,
Paw. AP_CALLS_HNDLD_00,
Paw. AP_CALLS_HNDLD_05,
Paw. AP_CALLS_HNDLD_10,
Paw. AP_CALLS_HNDLD_15,
Paw. AP_CALLS_HNDLD_20,
Paw. AP_CALLS_HNDLD_25

FROM dbo.PER_APPL_WYTH AS Paw

INNER JOIN dbo.Application Config AS AP ON Paw.AP_APPL = AP.Appl

WHERE Paw. AP_LOG_DATE BETWEEN '2008-09-01 00:00:00' AND '2008-09-04 00:00:00'
AND App. Siteid = 'GCLW'

My Error reads
Incorrect syntax near the keyword 'AS'. (in Red)

Any help would be great


missed a . on both sides
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-03 : 04:28:52
Also dont put spaces between . & columns

SELECT 
App.Siteid,
Paw.AP_LOG_DATE,
App.Appl,
Paw.AP_CALLS_OFFRD,
Paw.AP_IN_CALLS_HNDLD,
Paw.AP_CALLS_ABND_00,
Paw.AP_CALLS_HNDLD_00,
Paw.AP_CALLS_HNDLD_05,
Paw.AP_CALLS_HNDLD_10,
Paw.AP_CALLS_HNDLD_15,
Paw.AP_CALLS_HNDLD_20,
Paw.AP_CALLS_HNDLD_25

FROM dbo.PER_APPL_WYTH AS Paw

INNER JOIN dbo.[Application Config] AS AP ON Paw.AP_APPL = AP.Appl

WHERE Paw.AP_LOG_DATE BETWEEN '2008-09-01 00:00:00' AND '2008-09-04 00:00:00'
AND App.Siteid = 'GCLW'

Go to Top of Page

whitmoj
Yak Posting Veteran

68 Posts

Posted - 2008-10-03 : 04:44:19
quote:
Originally posted by visakh16

Also dont put spaces between . & columns

SELECT 
App.Siteid,
Paw.AP_LOG_DATE,
App.Appl,
Paw.AP_CALLS_OFFRD,
Paw.AP_IN_CALLS_HNDLD,
Paw.AP_CALLS_ABND_00,
Paw.AP_CALLS_HNDLD_00,
Paw.AP_CALLS_HNDLD_05,
Paw.AP_CALLS_HNDLD_10,
Paw.AP_CALLS_HNDLD_15,
Paw.AP_CALLS_HNDLD_20,
Paw.AP_CALLS_HNDLD_25

FROM dbo.PER_APPL_WYTH AS Paw

INNER JOIN dbo.[Application Config] AS AP ON Paw.AP_APPL = AP.Appl

WHERE Paw.AP_LOG_DATE BETWEEN '2008-09-01 00:00:00' AND '2008-09-04 00:00:00'
AND App.Siteid = 'GCLW'





Works fine Thanks
Go to Top of Page
   

- Advertisement -