SQL Syntax Error

hellfire45

Active Member
Joined
Jun 7, 2014
Messages
462
I'm getting a syntax error on this query below. It says "Syntax error on Join". I'm writing this the way I think it would be written in My SQL server 2014 so maybe its not fitting into Access. Can somebody check for me? Thank you so much!


Code:
SELECT FCL.EntityID as "File#", FCL.GroupNumNum as "Numer of Actions", FCL.ActionType as "Action Type", FCL.StartAction as "Action StartDate", FCL.End, ENT.Party3IDText as "Client ID"FROM dbo_FCLIT as "FCL"
LEFT OUTER JOIN dbo_Entities as "ENT" ON FCL.EntityNum = ENT.EntityNum
Where FCL.ActionType = "Answer Affir Defense" AND Party3IDText ="245204" OR Party3IDText = "327599";
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
What happens if you use the actual table names instead of the aliases?
 
Upvote 0
Is it that there's no space before your FROM clause?
Or the quotes around the alias table name?

I get asked for a parameter value (Ent.sKeyField1) using a table in my database if I use
SELECT Ent.sKeyField1 AS "File#" FROM tbl_SYS_System AS "Ent"

but not if I use
SELECT Ent.sKeyField1 AS "File#" FROM tbl_SYS_System Ent
I do however get the field name in quotes

If I use
SELECT Ent.sKeyField1 AS File# FROM tbl_SYS_System Ent
I get a reserved word on the #

To work as I intend I have to write it as
SELECT Ent.sKeyField1 AS File FROM tbl_SYS_System Ent
 
Upvote 0

Forum statistics

Threads
1,214,634
Messages
6,120,659
Members
448,975
Latest member
sweeberry

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top