Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query a Query? 1

Status
Not open for further replies.

IknowMe

Programmer
Aug 6, 2004
1,214
US
Say I have a Query based on several tables in my database can I query the Query to generate the report?

If I use the following to start a table query

"SELECT * from Main ect ect

what would the syntax be query a query named "Test"

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 



Hi,

Sure. Have done this many times.

Skip,

[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FOURTH[/red] on the [red]FIFTH[/red]
[tongue]
 
So where I am at is I have the tables and the query that is pulling the information from each table I need. I now need to query this query based on user selections made on a form (StD EndD ect).

I've been looking around at it seems I have to first ensure the query I will be querying is open.

So I think I may have it, but any suggestions or pointers would be appreciated.

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 




"...it seems I have to first ensure the query I will be querying is open"

Why? Is it in another database?
Code:
sSQL = "Select * " & _
"From MyHairyQueryThatHitsGazillionTables " & _ 
"Where TheImportantDate Between #" & std & "# And #" & endd & "#"

Skip,
[sub]
[glasses] [b]To be safe on the [red]FOURTH[/red],[/b]
[b]Don't take a [red]FIFTH[/red] on the [red]THIRD[/red][/b]
[b]Or you might not come [red]FOURTH[/red] on the [red]FIFTH[/red][/b]
 [tongue][/sub]
 
Thanks Skip,

I am still working my query the query string and assume I can call the query the same as I would a table so to start I have

stReport = "SELECT * from Test"

'stReport = stReport & " WHERE [Test].Date Between #5/1/2001# And #5/31/2001#"

stReport = stReport & " and ((([Test].Date)BETWEEN #" & dS & "# AND #" & dE & "#))"

It seems we're missing each other by inches Skip, thanks so muchfor your help I appear to be woking now.

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Oh and a star!

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 




Mucho Grass!

Skip,

[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top