Basic SQL query question

  • Thread starter Thread starter Xmas
  • Start date Start date
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
 
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.
 
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.
 
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 _ .
 
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.
 
Back
Top