dbTalk Databases Forums  

Base a query on a query

comp.databases.ms-access comp.databases.ms-access


Discuss Base a query on a query in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
JohnP
 
Posts: n/a

Default Re: Base a query on a query - 03-05-2011 , 12:14 PM






OK after some thinking and thanks to your input, I believe I was able
to combine the two queries into one.

DoCmd.RunSQL " INSERT INTO tblLC ( strDescription, strAC,
sngLCPrice ) SELECT [11030204].strDescription, [11030204].strAC,
[11030204].[000111022001] " _
& " FROM [11030204] WHERE ((([11030204].[000111022001]) Is Not Null
And ([11030204].[000111022001])<=nz([11030204].[001011022402]) And
([11030204].[000111022001])<=nz([11030204].[000211022301]))) ;"

Since I know the table name and the number and name of the fields I
could come up with the appropriate SQL string statement. We'll see how
it behaves if we have more fields.

Many thanks,
John

Reply With Quote
  #12  
Old   
Salad
 
Posts: n/a

Default Re: Base a query on a query - 03-05-2011 , 01:00 PM






JohnP wrote:

Quote:
OK after some thinking and thanks to your input, I believe I was able
to combine the two queries into one.

DoCmd.RunSQL " INSERT INTO tblLC ( strDescription, strAC,
sngLCPrice ) SELECT [11030204].strDescription, [11030204].strAC,
[11030204].[000111022001] " _
& " FROM [11030204] WHERE ((([11030204].[000111022001]) Is Not Null
And ([11030204].[000111022001])<=nz([11030204].[001011022402]) And
([11030204].[000111022001])<=nz([11030204].[000211022301]))) ;"

Since I know the table name and the number and name of the fields I
could come up with the appropriate SQL string statement. We'll see how
it behaves if we have more fields.

Many thanks,
John
Hope you get it to work. I was simply providing a method example to
demonstrate to you on how to define and assign a SQL statement to
Query5. IOW, create the Sql statement on the fly and update the SQL
statement in Query5. No brain surgery required.

Reply With Quote
  #13  
Old   
JohnP
 
Posts: n/a

Default Re: Base a query on a query - 03-07-2011 , 01:30 AM



Many thanks Salad for your assistance.
John

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.