Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 23rd, 2014, 02:30 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access - Passing parameters to subqueries?

I have an access database that has a fairly complicated saved query in place.

I'm going to spare the details except to say that there's a table "R" that has a bunch of records containing timestamps, user IDs, and a bunch of domain specific info.

The query in question has to return a summary of numbers on each user ID, including total number of records that meet an assortment of conditions.

I decided since I need to do a bunch of counts on one table but of different lines that meant subqueries, and to keep it vaguely readable I put each subquery in it's own saved query (some of which have further subqueries as saved queries) and join them together to get my results.

Here's where I problem has come up -- I suddenly need to be able to do that lookup for an arbitrary date range, rather than all of the data.

I could do that by combining all of the subqueries inline, but that would quickly become difficult to follow and modify if it ever needs changed again.

I'd rather just add a parameter to the bottom level queries that actually work with the data, and pass the parameter from the final top level query down to the save subqueries, but I have not a clue how to do that.

Concept:

Query A joins queries B, C, and D. B joins E and F. C, D, E, and F all do various totals on different lines of table G. I need to be able to query A and get results for a specific range of a timestamp column in G. B-F would all be using the same timestamp range for this calculation.
Reply With Quote
  #2 (permalink)  
Old July 21st, 2016, 07:00 AM
andersons
Guest
 
Posts: n/a
Default

The query in question has to return a summary of numbers on each user ID, including total number of records that meet an assortment of conditions.
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
passing parameters to Access Report murtazasif Access VBA 2 November 6th, 2007 11:32 AM
Passing parameters to Access query pcassistnw Access 0 March 2nd, 2007 10:07 PM
Passing Multiple Parameters into Access Query rit01 Classic ASP Databases 1 October 26th, 2005 04:00 PM
Access Forms Open Method of Passing Parameters androman Access VBA 8 September 22nd, 2004 09:04 AM
Access subqueries with parameters moved to SQL Mitch Access 8 March 10th, 2004 12:27 PM



All times are GMT -4. The time now is 11:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.