strSQL = "SELECT tblf107grpDept.DeptName AS Org, tblUsers.UserFName + ' ' + tblUsers.UserLName AS Requestor,CONVERT(varchar,
tblF107Log.RecDate) + ' EST' AS [Date Received], tblF107Log.Comments AS Comments, tblF107Log.IDFrm FROM dbo_tblF107grpDept
RIGHT JOIN tblUsers ON tblF107grpDept.IDDept = tblUsers.IDDeptfk RIGHT JOIN tblF107Log ON tblUsers.UserID =
tblF107Log.IDContact WHERE IDFrm = " & request.querystring("IDForm") & ";"
Set rsCoordinationSection = objConn.Execute(strSQL)
This is the error I am getting from the code above:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'tblF107grpDept.IDDept = tblUsers.IDDeptfk RIGHT JOIN tblF107Log ON tblUsers.UserID = tblF107Log.IDContact'.
I am also getting an error stating the convert function is undefined. The SQL was created, I think, for SQL server 2000, but I am trying to get it to work with ACCESS 2003. Any help or suggestions will be greatly appreciated.
Thanks!
3 4244 MMcCarthy 14,534
Recognized Expert Moderator MVP
Add in a space before the word CONVERT.
Either remove the dbo_ from the table name dbo_tblF107grpDept or add it in all the time.
Also bracket off the joins as follows:
FROM ((tblF107grpDept RIGHT JOIN tblUsers ON tblF107grpDept.IDDept = tblUsers.IDDeptfk) RIGHT JOIN tblF107Log ON tblUsers.UserID = tblF107Log.IDContact)
strSQL = "SELECT tblf107grpDept.DeptName AS Org, tblUsers.UserFName + ' ' + tblUsers.UserLName AS Requestor,CONVERT(varchar,
tblF107Log.RecDate) + ' EST' AS [Date Received], tblF107Log.Comments AS Comments, tblF107Log.IDFrm FROM dbo_tblF107grpDept
RIGHT JOIN tblUsers ON tblF107grpDept.IDDept = tblUsers.IDDeptfk RIGHT JOIN tblF107Log ON tblUsers.UserID =
tblF107Log.IDContact WHERE IDFrm = " & request.querystring("IDForm") & ";"
Set rsCoordinationSection = objConn.Execute(strSQL)
This is the error I am getting from the code above:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'tblF107grpDept.IDDept = tblUsers.IDDeptfk RIGHT JOIN tblF107Log ON tblUsers.UserID = tblF107Log.IDContact'.
I am also getting an error stating the convert function is undefined. The SQL was created, I think, for SQL server 2000, but I am trying to get it to work with ACCESS 2003. Any help or suggestions will be greatly appreciated.
Thanks!
I tried everything you mentioned, but now I am getting a syntax error message saying error in join operation. Here is the current code:
strSQL = "SELECT tblf107grpDept.DeptName AS Org, tblUsers.UserFName + ' ' + tblUsers.UserLName AS Requestor,
CONVERT(varchar, tblF107Log.RecDate) + ' EST' AS [Date Received], tblF107Log.Comments AS Comments, tblF107Log.IDFrm FROM
((tblF107grpDept Right Join tblUSers on tblF107grpDept.IDDept = tblUsers.IDDeptfk) Right Join tblF107Log on
tblUsers.UserId = tblF107Log.IDContact) WHERE IDFrm = " & request.querystring("IDForm")& ";"
Thanks for the help and suggestion. I still don't know what is wrong.
MMcCarthy 14,534
Recognized Expert Moderator MVP
FROM ((tblF107grpDept Right Join tblUSers on tblF107grpDept.IDDept = tblUsers.IDDeptfk) Right Join tblF107Log on tblUsers.UserId = tblF107Log.IDContact)
Because you are getting an error on the join expression I would suggest that you do the following:
Check all the table names - if you are using an odbc connection you have to use the table name that is showing in access. However, if you are connecting using ADO straight to the backend or using a SQL pass thru query then you have to use the table name in the SQL backend. Check for dbo. or dbo_ before the table names.
Check all your connection fields - are they of the same type when used in connections. Have you got the field names correct?
Lastly if you are using an odbc connection to link your tables then put the sql statement into a blank query and go to design view. This can sometimes make the problem obvious.
I tried everything you mentioned, but now I am getting a syntax error message saying error in join operation. Here is the current code:
strSQL = "SELECT tblf107grpDept.DeptName AS Org, tblUsers.UserFName + ' ' + tblUsers.UserLName AS Requestor,
CONVERT(varchar, tblF107Log.RecDate) + ' EST' AS [Date Received], tblF107Log.Comments AS Comments, tblF107Log.IDFrm FROM
((tblF107grpDept Right Join tblUSers on tblF107grpDept.IDDept = tblUsers.IDDeptfk) Right Join tblF107Log on
tblUsers.UserId = tblF107Log.IDContact) WHERE IDFrm = " & request.querystring("IDForm")& ";"
Thanks for the help and suggestion. I still don't know what is wrong.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Phil Powell |
last post by:
I'm not kidding, the only reason yesterday you didn't hear from me was
because I wasn't coding, but today I am doing something quick, and yes, as
always it failed.. right at the SQL statement:
...
|
by: sam |
last post by:
When I run this SQL query:
SELECT u.*, o.*
FROM users u, orders o
WHERE
TO_DAYS(o.order_date)
BETWEEN
TO_DAYS('2003-09-20')-10
AND
TO_DAYS('2003-09-20')+10
|
by: mike420 |
last post by:
I think everyone who used Python will agree that its syntax is
the best thing going for it. It is very readable and easy
for everyone to learn. But, Python does not a have very good
macro...
|
by: middletree |
last post by:
I've seen posts here and elsewhere which read something along the lines of
"PULLNG MY HAIR OUT!!!!!" or "HELLLLPPP!". Well, I know that kind of
subject line isn't descriptive, but I sure can...
|
by: Kevin Michael Reed |
last post by:
------=_NextPart_000_002B_01C34DF8.C34C94F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Assistance required.
I have 3 tables:
| |
by: p |
last post by:
I'm trying to put a query into VBA code and its giving me difficulties.
I would like to put the following query:
SELECT tbl_Workload.Priority, tbl_Workload.Number AS Num,
tbl_Workload.Name,...
|
by: Ole Nielsby |
last post by:
In the old ages when I was taught Pascal, the manual had nice
syntax diagrams. Each grammatical structure was shown as
round boxes connected by arrows, with a model railway look,
with the boxes...
|
by: bilibytes |
last post by:
Hello, i need some help i am getting this error:
You have an error in your SQL syntax;
check the manual that corresponds to your MySQL
server version for the right syntax to use near
'GROUP...
|
by: Yesurbius |
last post by:
I am receiving the following error when attempting to run my query. In my mind - this error should not be happening - its a straight-forward query with a subquery. I am using Access 2003 with all...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |