XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 8th, 2012, 03:22 AM
a_legs a_legs is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2011
Posts: 11 a_legs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 47 m 13 sec
Reputation Power: 0
Parameter queries

Hello all. I have an sql query that is working fine for me when I run it as a straight query. I was showed how to make an xml report out of this query which i've done below.

<report title="Account Balance" description="Reports the account balances" active="1">
<query>
select demo.demographic_no, demo.last_name, demo.first_name, demo.code FROM
(SELECT demographic_no, last_name, first_name, chart_no FROM demographic WHERE patient_status='AC' AND code IN ('{code}')) AS demo LEFT OUTER JOIN (SELECT id, demographic_no FROM billing_on_cheader1) AS ch1 ON demo.demographic_no = ch1.demographic_no INNER JOIN (SELECT demographic_no, appointment_date FROM appointment WHERE appointment_date = '{date}') GROUP BY demographic_no) AS appt ON demo.demographic_no = appt.demographic_no GROUP BY demographic_no
</query>
<param id="date" type="list" description="Date">
<param-query> SELECT DISTINCT appointment_date, appointment_date FROM appointment WHERE appointment_date >= curdate() AND appointment_date < (curdate() + INTERVAL 5 DAY);</param-query>
</param>
<param id="code" type="list" description="With payment codes">
<param-query> SELECT 'IN', ('IN', 'AC', 'NB'), IN, ALL;</param-query>
</param>
</report>


my problem is that I don't understand how the parameter query works. I was able to do the first one (so the user can choose the date they want to use in the query from a list). The other parameter I want the user to be able to choose is a list of codes (IN, AC, NB). I want a little box that lets them choose to use either 'IN' or 'IN', 'AC', 'NB' in that code field. I've tried to do this as you can see above but it keeps give me an error. Any suggestions?

Thanks!

Alexandra,

Reply With Quote
  #2  
Old March 8th, 2012, 03:32 AM
cafelatte cafelatte is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2008
Posts: 1,923 cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 5 Days 16 h 21 m 8 sec
Reputation Power: 377
Not that this is the right forum to be discussing this, but isn't <param> simply used to define parameters for plugins embedded with an html <object>?

What are you basing this upon, or are you just making it up?

And that query is a thing of horror!

Reply With Quote
  #3  
Old March 8th, 2012, 12:24 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 43rd Plane (26000 - 26499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,443 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 14 h 21 m 52 sec
Reputation Power: 4141
thread moved to xml forum
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Parameter queries

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap