PC Review


Reply
Thread Tools Rate Thread

Basic SQL query question

 
 
Xmas
Guest
Posts: n/a
 
      7th Nov 2009
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
 
Reply With Quote
 
 
 
 
rick_brandt@charter.net
Guest
Posts: n/a
 
      7th Nov 2009
Xmas 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)
>
> 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.


 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      7th Nov 2009
On Sat, 7 Nov 2009 13:20:09 -0000, Xmas <(E-Mail Removed)> 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.

--

John W. Vinson [MVP]
 
Reply With Quote
 
RoyVidar
Guest
Posts: n/a
 
      7th Nov 2009
John W. Vinson wrote:
>
> 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 _ .

--
Roy-Vidar


 
Reply With Quote
 
Shoehey Muta
Guest
Posts: n/a
 
      8th Nov 2009
sorry.
"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:(E-Mail Removed)...
> On Sat, 7 Nov 2009 13:20:09 -0000, Xmas <(E-Mail Removed)> 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.
>
> --
>
> John W. Vinson [MVP]


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Question in Web Query...HELP!! Rick Microsoft Excel Misc 0 19th Nov 2009 04:28 AM
Basic SQL query question Xmas Microsoft Access 4 8th Nov 2009 05:27 PM
Update Query basic question =?Utf-8?B?RGFu?= Microsoft Access Queries 2 22nd Jun 2007 02:22 PM
Basic Query question Tom Microsoft Access 1 11th Dec 2006 04:08 AM
Basic query Question =?Utf-8?B?S2l3aSBsb3N0IGluIEFzaWE=?= Microsoft Access Queries 1 28th Aug 2004 05:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:23 AM.