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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is This Possible - 3 Access Queries

Status
Not open for further replies.

kiwieur

Technical User
Apr 25, 2006
200
GB
Hi,

I have 3 access queries

qry01_SalesHistory gets the data from a linked table with parameters for start & end date

qry02_SalesHistory queries qry01 and groups and sums data

qry03_saleshistory queries qry02 and displays the end data.

How can I run qry03_SalesHistory from an ASP page as it keeps telling me it expected 2 parameters but the dates are not in qry03.

I hoep i have explained this properly

Regards

Paul

 
Just write one (proper) query?

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Post the SQL of your queries (and maybe some info on your database structure) and one of the SQL gods around here will whip you out a consolidated query faster than you can spit.

As John suggests, it will then likely be a lot easier to run.
 
Subquery the 3 sets like Query 1 HAVING (Query 2 HAVING (Query 3))

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never inside the 'loop' " - DreX 2005
 
but as mentioned before the best way is to proper structure an SQL statement, and too much crosslinking is unproductive.

one option is if query1 is a chronic pull of data for whatever group of people, then put it into a application variable, if it's something catered to each client, then use a session variable to hold the data, and if each individual pull of query1 is going to be different, then you'll just have to have a fast web server/data server/connection between the two.

examples of the aforementioned is if it's say a chat log for a game server, where ever person that visits gets the same data always, then application level it, then it saves requeries to the data serv.

second example is that you have clients that are looking at specific reports for them, then poll data per year, pre month, per week whatever and session it, when they change date ranges, repoll

last example is unfortunately all too common, any environment with too many parameters/options for the client to pick from.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never inside the 'loop' " - DreX 2005
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top