Tuesday, March 27, 2012

Embed SQL statement in another SQL statement

Suppose I have an MS access database with query1 and query2. Query2 uses
query1 something like this:

Select table.* from (table left join query1 on field1=field2)

Now I want to make a change in query1 to change the behaviour of query2. But
this cannot be done in a live environment because I have to shut down the
application, make the change in the database and start the application
again. What I can do is make a query 3 in my application (instead of in the
database) that is initially does the same as query2 like this:

Select table.* from (table left join -->some SQL code to embed query1<-- on
field1=field2)

Once I know how to do this, I can change the "embedded" sql code to my
needs.

Question is: how do I "embed" SQL code in another statement?"John Kenickney" <spam.trap@.bigfoot.com> wrote in message news:<b0909e7389d49cec0cf4ddf5330bce77@.news.teranews.com >...
> Suppose I have an MS access database with query1 and query2. Query2 uses
> query1 something like this:
> Select table.* from (table left join query1 on field1=field2)
> Now I want to make a change in query1 to change the behaviour of query2. But
> this cannot be done in a live environment because I have to shut down the
> application, make the change in the database and start the application
> again. What I can do is make a query 3 in my application (instead of in the
> database) that is initially does the same as query2 like this:
> Select table.* from (table left join -->some SQL code to embed query1<-- on
> field1=field2)
> Once I know how to do this, I can change the "embedded" sql code to my
> needs.
> Question is: how do I "embed" SQL code in another statement?

You should probably post this in an Access forum to get a better response.

Simon

No comments:

Post a Comment