I am new to using Access but have a background in SQL. I can get queries running using simple SQL statements with no problem, but you can only use one SQL statement per query (or so it seems)
I want to instantiate a table from an SELECT INTO and then use INSERT INTO to add more rows. Is there a way to do that in a single query?
> I am new to using Access but have a background in SQL. I can get > queries running using simple SQL statements with no problem, but you can > only use one SQL statement per query (or so it seems)
> I want to instantiate a table from an SELECT INTO and then use INSERT > INTO to add more rows. Is there a way to do that in a single query?
Access doesn't "do" multiple SQL statements. The closest thing is to use VBA code to execute each statement.
On Sat, 7 Nov 2009 13:20:09 -0000, Xmas <m...@privacy.net> wrote: >Hi
>I am new to using Access but have a background in SQL. I can get >queries running using simple SQL statements with no problem, but you can >only use one SQL statement per query (or so it seems)
That is correct. One of several tricky "dialect" differences (another is that Access/JET/ACE uses * and ? as wildcards instead of % and _).
>I want to instantiate a table from an SELECT INTO and then use INSERT >INTO to add more rows. Is there a way to do that in a single query?
No. You can call multiple queries in sequence from a Macro or from VBA code, though; or (depending on the nature of these queries) base a SELECT INTO on a UNION query.
> That is correct. One of several tricky "dialect" differences (another > is that Access/JET/ACE uses * and ? as wildcards instead of % and _).
For the interface, that is true, for Access/JET/ACE, unless you check the SQL Server Compatible Syntax (ANSI 92), which will require % and _.
For data manipulation through code, I think it will depend on method, or Library. With DAO I think you'll use * and ?, while with ADO, you need % or _ .
> On Sat, 7 Nov 2009 13:20:09 -0000, Xmas <m...@privacy.net> wrote:
>>Hi
>>I am new to using Access but have a background in SQL. I can get >>queries running using simple SQL statements with no problem, but you can >>only use one SQL statement per query (or so it seems)
> That is correct. One of several tricky "dialect" differences (another is > that > Access/JET/ACE uses * and ? as wildcards instead of % and _).
>>I want to instantiate a table from an SELECT INTO and then use INSERT >>INTO to add more rows. Is there a way to do that in a single query?
> No. You can call multiple queries in sequence from a Macro or from VBA > code, > though; or (depending on the nature of these queries) base a SELECT INTO > on a > UNION query.