I Get "Syntax error in query. Incomplete query clause." (3450) while running this code: - strSQL = "SELECT Calendar.MyDate, Calendar.MyTime, Calendar.Currency, Calendar.[Data Released]," & _
-
" Calendar.Forecast, Calendar.Previous, Calendar.Impact, [" & tblname & "].F2," & _
-
" [" & tblname & "].F3, [" & tblname & "].F4, [" & tblname & "].F5," & _
-
" [" & tblname & "].F6, [" & tblname & "].F7" & _
-
" INTO " & varData(i) & " " & _
-
" FROM Calendar INNER JOIN [" & tblname & "] ON Calendar.MyDate = [" & tblname & "].F1" & _
-
" WHERE (((Calendar.Currency)='" & varData(i) & "') AND (([" & tblname & "].F2)" & _
-
" Between [Calendar].[MyTime] And [Calendar].[Limit]));"
-
DoCmd.RunSQL strSQL
Can anyone spot the problem?
Thanks a bunch in advanced!
Tomba.
3 1555
Ok, I got the syntax right, but now I have another problem - sorry for bothering:\
For some reason, after running the code below, the records on the table I've created gets deleted (access prmopts me a dialogue box notifying that the existing table I created is going to be deleted before the query is executed, and asking me whether I want to continue or not).
I'll really appreciate any further help! - Do
-
If varData(i) <> "EUR" Then
-
strSQL = "SELECT Calendar.MyDate, Calendar.MyTime, Calendar.Currency, Calendar.[Data Released]," & _
-
" Calendar.Forecast, Calendar.Previous, Calendar.Impact, [" & tblname & "].F2," & _
-
" [" & tblname & "].F3, [" & tblname & "].F4, [" & tblname & "].F5," & _
-
" [" & tblname & "].F6, [" & tblname & "].F7" & _
-
" INTO [" & varData(i) & "-" & tblname & "]" & _
-
" FROM Calendar INNER JOIN [" & tblname & "] ON Calendar.MyDate = [" & tblname & "].F1" & _
-
" WHERE (((Calendar.Currency)='" & varData(i) & "')" & _
-
" AND (([" & tblname & "].F2) Between [Calendar].MyTime And [Calendar].Limit));"
-
Else
-
strSQL = "SELECT Calendar.MyDate, Calendar.MyTime, Calendar.Currency, Calendar.[Data Released]," & _
-
" Calendar.Forecast, Calendar.Previous, Calendar.Impact, [" & tblname & "].F2," & _
-
" [" & tblname & "].F3, [" & tblname & "].F4, [" & tblname & "].F5," & _
-
" [" & tblname & "].F6, [" & tblname & "].F7" & _
-
" INTO [" & varData(i) & "-" & tblname & "]" & _
-
" FROM Calendar INNER JOIN [" & tblname & "] ON Calendar.MyDate = [" & tblname & "].F1" & _
-
" WHERE (((Calendar.Currency)='EUR' OR (Calendar.Currency)='E-12' OR (Calendar.Currency)='GER')" & _
-
" AND (([" & tblname & "].F2) Between [Calendar].MyTime And [Calendar].Limit));"
-
End If
-
i = i + 1
-
DoCmd.RunSQL strSQL
-
Loop Until i = 2
Thanx alot!
Tomba.
NeoPa 32,556
Expert Mod 16PB
SELECT INTO (What you're using) is a Make Table query.
That's what they do if they find the destination table already exists.
You probably want an INSERT INTO (Append) query instead.
Remember to clear the existing records first when you run it - assuming that's what you need it to do.
SELECT INTO (What you're using) is a Make Table query.
That's what they do if they find the destination table already exists.
You probably want an INSERT INTO (Append) query instead.
Remember to clear the existing records first when you run it - assuming that's what you need it to do.
Append query syntx ... -
INSERT INTO Tablename1 (Field1, Field2)
-
SELECT Field1, Field2
-
FROM TableName2;
Mary
Sign in to post your reply or Sign up for a free account.
Similar topics
by: ajsiegel |
last post by:
Arthur wrote:
>> And either intuitively, or consciously, he is doing something that
>> offsets it from something truly intergrated into the core of the
>> language. By breakling all of his own...
|
by: jesse |
last post by:
In java, one constructor can call another constructor through this(...)
for instance
class foo
{
public:
foo(int k) { this(k,false)};
foo(int k, boolean m){...};
}
|
by: Xiangliang Meng |
last post by:
Hi, all.
What are the benefit and the drawback of defining a class embedded inside
another class?
For example:
class List
{
public:
|
by: Paul Cochrane |
last post by:
Hi all,
I've got an application that I'm writing that autogenerates python code
which I then execute with exec(). I know that this is not the best way to
run things, and I'm not 100% sure as to...
|
by: christopher diggins |
last post by:
I have posted a C# critique at
http://www.heron-language.com/c-sharp-critique.html. To summarize I bring up
the following issues :
- unsafe code
- attributes
- garbage collection
-...
|
by: aum |
last post by:
Hi,
I'm a Python programmer, just starting to get into javascript. On reading
some of the js guides, and not liking any of the OO usage patterns I saw,
I've cooked up something which python...
|
by: Yusuf |
last post by:
I'm sorry for the second post in as many hours, and both about structs.
The code below compiles. The variables test1 and test2 are structures
of datatype teststruct1 and teststruct2. The size of...
|
by: rohitkumar |
last post by:
this is my code to calculate the sum of digits in a number
for eg. 432567
sum =4+3+2+5+6+7=27
i 'm using turboc++ compiler from borland and i 'm runing my program on DOS.
...
|
by: sagar |
last post by:
Hi,
I have a C file(add.c) in which i have a function called add.now
i want to call the same add function from another file sub.c .Can any1
tell how to do that...
Thanks in advance
Mark
|
by: pradeep |
last post by:
Hello friends:
I have the following code,
char* MyClass::MyMethod()
{
char* ptr = new char; // space for NULL terminator
ptr = "hello";
return ptr;
delete ptr;
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |