Basic SQL query question

X

Xmas

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)

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?

Thanks
 
R

rick_brandt

Xmas said:
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)

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.
 
J

John W. Vinson

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.
 
R

RoyVidar

John said:
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 _ .
 
S

Shoehey Muta

sorry.
John W. Vinson said:
That is correct. One of several tricky "dialect" differences (another is
that
Access/JET/ACE uses * and ? as wildcards instead of % and _).


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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top