473,378 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Nested Sql - "Syntax Error in From Clause"

Please help me with this sql:
SELECT z005aNORTHEAST_3days_Formula.Region,
z005aNORTHEAST_3days_Formula.DiffofClaimsAssignmen t
FROM (SELECT [test].Region, ([test].[Date to Service Provider])-(
[test].[Date Received By TNT]) AS DiffofClaimsAssignment
FROM
(SELECT [Claims Table 02_23_05].Region, [Claims Table 02_23_05].[Date
received by TNT], [Claims Table 02_23_05].[Date To Service Provider],
[Claims Table 02_23_05].[Date Acknowledged by DSP]
FROM [Claims Table 02_23_05]
WHERE ((([Claims Table 02_23_05].Region)="NORTHEAST"))) as test) AS
z005aNORTHEAST_3days_Formula
WHERE (((z005aNORTHEAST_3days_Formula.DiffofClaimsAssign ment)<=3 ));

Access XP and 2003 returned correct data and correct nbr of records.
After the query was saved and re-opened, it also provided correct data
and nbr of records. Yet, whenever I revisited the design view and
clicked on "Save", Access popped up an error msg: "Syntax Error in FROM
Clause". Currently, I have only 400 records from the source table and
the sql generates 4 rows of returned records. I do not know how to fix
it & could not understand why Access automatically changed the sql
after I reopend it (plz see below), but still show error msg. Thank you
in advance. James in Plano
SELECT z005aNORTHEAST_3days_Formula.Region,
z005aNORTHEAST_3days_Formula.DiffofClaimsAssignmen t
FROM [SELECT [test].Region, ([test].[Date to Service Provider])-(
[test].[Date Received By TNT]) AS DiffofClaimsAssignment
FROM
(SELECT [Claims Table 02_23_05].Region, [Claims Table 02_23_05].[Date
received by TNT], [Claims Table 02_23_05].[Date To Service Provider],
[Claims Table 02_23_05].[Date Acknowledged by DSP]
FROM [Claims Table 02_23_05]
WHERE ((([Claims Table 02_23_05].Region)="NORTHEAST"))) as test]. AS
z005aNORTHEAST_3days_Formula
WHERE (((z005aNORTHEAST_3days_Formula.DiffofClaimsAssign ment)<=3 ));

Nov 13 '05 #1
4 5130
James,

This is likely the same nastly little problem that I've been struggling
with for years. Access insists on replacing the parentheses around
your subquery with a square bracket in front and a square
bracket/period on the end. If you have square brackets anywhere else
in your query, it's likely to fail. If you fix it by restoring the
query to its original state, Access will again replace the parentheses
the next time you edit the query.

What I normally do is I keep a good copy of the query in a text file.
Every time I need to change the query, I update the text file and paste
the results into the query designer (SQL view).

If someone knows a way to stop Access from rewriting these queries,
please tell us! I certainly hope that this problem is fixed in the
newest version of Access.

Bill E.
Hollywood, FL

Nov 13 '05 #2
can't you just save your subquery as a seperate query ?

Nov 13 '05 #3
Thanks, Bill.
I'll keep a good copy separately for future use. Wonder if Microsoft
would listen to their customers' complains [!?! :)]
Have a great Friday. James in Plano

bi********@netscape.net wrote:
James,

This is likely the same nastly little problem that I've been struggling
with for years. Access insists on replacing the parentheses around
your subquery with a square bracket in front and a square
bracket/period on the end. If you have square brackets anywhere else
in your query, it's likely to fail. If you fix it by restoring the
query to its original state, Access will again replace the parentheses
the next time you edit the query.

What I normally do is I keep a good copy of the query in a text file.
Every time I need to change the query, I update the text file and paste
the results into the query designer (SQL view).

If someone knows a way to stop Access from rewriting these queries,
please tell us! I certainly hope that this problem is fixed in the
newest version of Access.

Bill E.
Hollywood, FL


Nov 13 '05 #4
Surely can, but was hoping to run 1 query instead of many for the same
result.

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Larry Bates | last post by:
It doesn't happen often, but once in a while I will introduce a syntax error into a Python program I'm working on (in IDLE) and doing File-Check responds with the expected "Failed to check, syntax...
1
by: mlke | last post by:
I would like to select the top 10 record from a table? How can I do it? In MS SQL, it's easy using select top 10 from table1. But in oracle database, I can't use top, anyone have any suggestions?...
10
by: Jay Chan | last post by:
I keep getting the following error message when I run a serie of SQL commands: Server: Msg 9002, Level 17, State 6, Line 15 The log file for database 'tempdb' is full. Back up the transaction...
1
by: Amir | last post by:
Hi all, I have a table called PTRANS with few columns (see create script below). I have created a view on top that this table VwTransaction (See below) I can now run this query without a...
2
by: P. Adhia | last post by:
Hello All, I am trying to redirect-restore a backup of a DB2 V6.x system (AIX 4.x) on DB2 V8.2 system (AIX 5.2). I get the above error with no other details. db2diag.log has a series of error...
2
by: j-in-uk | last post by:
Hi, I seem to get the error on DataRelation r2, the values are unique so I don't know why I am getting the error. Any sugesstions? DataRelation r1 = ds.Relations.Add(dtContinent_ContinentID,...
1
by: sesmap | last post by:
I am not certain if I set this up correctly - all help would be appreciated: SELECT .ACCOUNTID, .PUBCODE, .NAME, .PIATYPE, .FOD, .SUBSLNGTH, .RATECODE, .CURRENTBAL, .EOGDATE, .TELEPHONE,...
1
by: samneil | last post by:
I have 1 Database( MS Access) with 9 tables and 6 queries, Now I'm trying to view my 2 different tables on my VB6.0 using 2 Datagrids and 2"adodc".... here are the names of my two tables:...
1
by: canugi | last post by:
I need to store the contents of an SQL "in clause" in an MS Access 2000 table. I use MS Access version 9.0.8960 (SP3) This is my statement (and it works fine with the explicit "in clause"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.