Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | 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 Search this Thread Display Modes
  #1 (permalink)  
Old May 4th, 2005, 11:13 AM
Registered User
 
Join Date: May 2005
Location: Pasadena, CA, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Combining Parameter Queries

Hi all,

I've been struggling with a SQL problem for over a week now. I am using Crystal Reports V8.5. My experience level is 'programmer', and this would be trivial to do in my programming language, but then I don't get the benefits of using reporting tools like Crystal, etc.

I have 3 tables - for simplicity I'll call them Index, Facility, Detail.

Index has 2 fields - {date}, and {pointer to Detail primary key}.
Facility has 2 fields - {Hospital}, and {Clinic}.
Detail has {primary key}, {date}, {clinic}, and {other misc fields}

Selecting by using a date range against the index will yield the least number of detail records.

The end result should be a query that asks the user for a date range, and a multiple selection of hospitals. All clinics associated with the selected hospitals should be included in the output (Each hospital may have several clinics).

Would it be best to join the detail table with the index table first, then use a 'while clinic in (parameter query)' syntax, or try to do the clinic parameter query first, then try to join to the detail and index tables?

I've been successful in doing each part separately, but don't know how to combine them. Any help would be appreciated.

Thank you,
Jere Neal

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
problem with parameter queries ph0neman Classic ASP Basics 2 July 1st, 2008 08:57 PM
Parameter Queries designdawg Access 13 March 5th, 2008 01:39 PM
Combining two Queries arholly Access 1 January 16th, 2007 06:40 PM
Using a parameter with 2 queries archMEL ASP.NET 2.0 Basics 2 September 19th, 2006 07:41 AM
Combining Queries or results from 2 queries Ford SQL Server 2000 24 November 7th, 2005 08:54 PM



All times are GMT -4. The time now is 08:03 AM.


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