Help witha query

2008-01-28 Thread Toby King
Hi there I have 2 tables in A MySQL database. A room table and a room occupancy table which stores records for a selected period of time. What I want to do is display all rooms (rooms 1-20) along with the status of the room. Currently my query is as follows: select distinct

RE: Help witha query

2008-01-28 Thread William
@houseoffusion.com Sent: 1/28/2008 2:05 PM Subject: Help witha query Hi there I have 2 tables in A MySQL database. A room table and a room occupancy table which stores records for a selected period of time. What I want to do is display all rooms (rooms 1-20) along with the status of the room

Re: Help witha query

2008-01-28 Thread Toby King
-Original Message- From: Toby King [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: 1/28/2008 2:05 PM Subject: Help witha query Hi there I have 2 tables in A MySQL database. A room table and a room occupancy table which stores records for a selected period of time

Re: Help witha query

2008-01-28 Thread Gerald Guido
You are going to want to use a LEFT OUTER JOIN. The easiest way to get your head around how joins work is to use a query builder. Toad for Mysql is a good app for this. MS access will work as well. On Jan 28, 2008 5:05 PM, Toby King [EMAIL PROTECTED] wrote: Hi there I have 2 tables in A

Re: Help witha query

2008-01-28 Thread Toby King
@houseoffusion.com Sent: 1/28/2008 2:05 PM Subject: Help witha query Hi there I have 2 tables in A MySQL database. A room table and a room occupancy table which stores records for a selected period of time. What I want to do is display all rooms (rooms 1-20) along with the status

RE: Help witha query

2008-01-28 Thread William Seiter
life? Go to: www.winninginthemargins.com Enter passkey: goldengrove Web Developer http://William.Seiter.com -Original Message- From: Toby King [mailto:[EMAIL PROTECTED] Sent: Monday, January 28, 2008 2:39 PM To: CF-Talk Subject: Re: Help witha query Hi basically the way I wanted

RE: Help witha query

2008-01-28 Thread William Seiter
PROTECTED] Sent: Monday, January 28, 2008 5:15 PM To: CF-Talk Subject: Re: Help witha query I thought I had the query working but its NOT quite right. I have been working on a smilar query and tried building the query with a query builder. Basically this query is joining 3 tables together. A table

Re: Help witha query

2008-01-28 Thread Azadi Saryev
that changed your life? go to: http://www.winninginthemargins.com and use passcod: GoldenGrove -Original Message- From: Toby King [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: 1/28/2008 2:05 PM Subject: Help witha query Hi there I have 2 tables in A MySQL

Re: Help with Query

2007-07-23 Thread Brian Peddle
If all your photos will have prices you won't need to left join you can just join on them. Joel Watson wrote: Joe, First of all I am not sure if you need LEFT JOIN for both comments and prices. My first example was based on the assumption that you could have photos without comments and

Re: Help with Query

2007-07-23 Thread Joel Watson
If all your photos will have prices you won't need to left join you can just join on them. Joel Watson wrote: That's true, but when I combine it with the LEFT OUTER JOIN on the comments, it screws up the comments. While it will return the prices information fine, it duplicates the

Re: Help with Query

2007-07-23 Thread Joel Watson
If all your photos will have prices you won't need to left join you can just join on them. Joel Watson wrote: That's true, but when I combine it with the LEFT OUTER JOIN on the comments, it screws up the comments. While it will return the prices information fine, it

Help with Query

2007-07-22 Thread Joel Watson
I have two tables, photos and comments. Their structures are as follows: photos table -- photoID photoTitle comments table -- commentID commentText photoID_fk I need to write a query that will allow me to display all the records in photos while also displaying

Re: Help with Query

2007-07-22 Thread Qasim Rasheed
First write your sql as SELECT p.photoID, p.photoTitle, c.commentId, c.commentText FROMphotos p LEFT OUTER JOIN comments c ON c.photoid_fk = p.photoid ORDER BY p.photoID, c.commentID Then output the query using cfoutput and group like this ul cfoutput

Re: Help with Query

2007-07-22 Thread Joel Watson
First write your sql as SELECT p.photoID, p.photoTitle, c.commentId, c.commentText FROMphotos p LEFT OUTER JOIN comments c ON c.photoid_fk = p.photoid ORDER BY p.photoID, c.commentID Then output the query using cfoutput and group like this ul cfoutput

Re: Help with Query

2007-07-22 Thread Joel Watson
First write your sql as SELECT p.photoID, p.photoTitle, c.commentId, c.commentText FROMphotos p LEFT OUTER JOIN comments c ON c.photoid_fk = p.photoid ORDER BY p.photoID, c.commentID Then output the query using cfoutput and group like this ul cfoutput

Re: Help with Query

2007-07-22 Thread Qasim Rasheed
Joe, First of all I am not sure if you need LEFT JOIN for both comments and prices. My first example was based on the assumption that you could have photos without comments and you might want to display those as well. It will help if you can paste the entire query and your output code. Thanks

Re: Help with Query

2007-07-22 Thread Joel Watson
Joe, First of all I am not sure if you need LEFT JOIN for both comments and prices. My first example was based on the assumption that you could have photos without comments and you might want to display those as well. It will help if you can paste the entire query and your output code. Thanks

Help with Query and Loop

2007-07-13 Thread Joel Watson
I have a table that contains user and station information, as well as a boolean field for whether the information is displayed or not. It looks roughly like this: uStationID userID_fk stationID_fk checked I have another very similar table that looks like this cStationID customerID_fk

Re: Help with Query and Loop

2007-07-13 Thread Janet MacKay
As an illustration, say that users table has the following entries: userID_fk [1] stationID_fk [4] checked [0] So here, the query will return only the value of the second and forth row. The forth row isn't checked. I'm assuming that's just a typo. If I'm understanding

Re: Help with Query and Loop

2007-07-13 Thread Joel Watson
As an illustration, say that users table has the following entries: userID_fk [1] stationID_fk [4] checked [0] So here, the query will return only the value of the second and forth row. The forth row isn't checked. I'm assuming that's just a typo. If I'm

Re: Help with Query and Loop

2007-07-13 Thread Janet MacKay
No magic involved. But glad you'll be alive to enjoy the weekend ;-) ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive:

Help - with query - sorry

2007-06-20 Thread coldfusion . developer
I haven't been able to find a good SQL forum that get's responses like here on CF-Talk. So I'm sorry, skip over this message is it urks you that I posted this. Sorry. I'm trying to figure out how the average rating (dbo.recipereviews.ratingID) where the average is greater than or equal to 4

Re: Help with query please.

2007-02-07 Thread Brent Shaub
Doug, Rick Root posted a thread which reminded me of the issue you are having. He's talking about a way to optimize a zip-lookup function perhaps similar to yours. That post is at: http://www.houseoffusion.com/groups/CF-Talk/thread.cfm/threadid:50216 Hope this is of some help. Seems to me

Help with query please.

2007-02-06 Thread Doug Brown
Ok, cannot seem to get this to work. I get a stack overflow due to the IN clause in the query. Microsoft says this is an issue with SQL2K and I need to do the following... !---MS STUFF--- CREATE TABLE #IN_values (au_id char(4)) INSERT INTO #IN_values select au_id FROM

Re: Help with query please.

2007-02-06 Thread Alan Rother
Hey Doug, Not sure what is exactly happening, but what I would recommend is first, capture the output SQL from your CF. To do this, take all the SQL and put it into a CFSAVECONTENT Then dump that out and try using it in SQL Query Analyzer. It should help narrow down where the issue is. -- Alan

Re: Help with query please.

2007-02-06 Thread Doug Brown
Well, this is the issue according to Microsoft. http://support.microsoft.com/kb/288095 Doug B. - Original Message - From: Alan Rother [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Tuesday, February 06, 2007 5:03 PM Subject: Re: Help with query please. Hey Doug

Re: Help with query please.

2007-02-06 Thread Alan Rother
] To: CF-Talk cf-talk@houseoffusion.com Sent: Tuesday, February 06, 2007 5:03 PM Subject: Re: Help with query please. Hey Doug, Not sure what is exactly happening, but what I would recommend is first, capture the output SQL from your CF. To do this, take all the SQL and put

Re: Help with query please.

2007-02-06 Thread Doug Brown
Well here is the offending code. Some of it is quite long especially the zip locator, so I will attempt to shorten it for the lists sake. Maybe someone can show me the best ways to handle this. First the zip locator runs and selects all zip codes that are within the specified criteria. 0-500

Need help with query with dates please

2005-01-31 Thread Mike Kear
I have a database containing a list of events (birthdays, anniversaries etc), and want to produce a listing of the events relating to this week, this month, today etc as the user requests on the form I give them. Because not everyone's birth year is known, not all the birthdays have a year. they

Re: Need help with query with dates please

2005-01-31 Thread Umer Farooq
assuming you have two date variables.. startDate and endDate.. WHERE (day #day(startDate)#) AND (month #month(startDate)#) AND (day #day(endDate)#) AND (month #month(endDate)#) Mike Kear wrote: I have a database containing a list of events (birthdays, anniversaries etc), and want

Re: Help: Strange Query of Query Error

2004-05-27 Thread Thomas Chiverton
On Wednesday 26 May 2004 19:07 pm, Alexander Sherwood wrote: I'm not aware of any restrictions on the data types a CF query can contain. Am I wrong? It would be restricted to valid SQL types, wouldn't it ? How the hell do you get a CFC into a query column to run a QoQ on anyway ? I think you

Help: Strange Query of Query Error

2004-05-26 Thread Alexander Sherwood
Has anyone run into errors when doing a Query of a Query where one of the columns holds a CFC? I'm not aware of any restrictions on the data types a CF query can contain. Am I wrong? Thanks! -- Alex [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Re: Need help with Query

2004-02-08 Thread Jochem van Dieten
Jake. wrote: SELECT AVG(r.rating) AS rating, r.LinkIDFK2 FROM Reviews r INNER JOIN Traffic t ON r.LinkIDFK2 = t.LinkIDFK GROUP BY LinkIDFK2 ORDER BY AVG(r.rating) DESC, t.Hits DESC Sorry, same problem: [MERANT][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access

Need help with Query

2004-02-07 Thread Jake McKee
OK, I'm trying to write a hefty query and having a bit of trouble. I'm trying to find the highest rated items (max of 10 and based on an average of all the times that item was rated). Since many of the top rated items will have the same rating, and I need to choose the top 10, I further want to

Re: Need help with Query

2004-02-07 Thread Jochem van Dieten
Jake McKee wrote: I'm trying to find the highest rated items (max of 10 and based on an average of all the times that item was rated). Since many of the top rated items will have the same rating, and I need to choose the top 10, I further want to base it on traffic to that item. So said

Re:Need help with Query

2004-02-07 Thread Jake .
SELECT AVG(r.rating) AS rating, r.LinkIDFK2 FROM Reviews r INNER JOIN Traffic t ON r.LinkIDFK2 = t.LinkIDFK GROUP BY LinkIDFK2 ORDER BY rating DESC, t.Hits DESC Depending on your database you can usually limit the numer of results by using LIMIT or TOP. I'm currently using Access. I

Re: Need help with Query

2004-02-07 Thread Jochem van Dieten
Jake. wrote: SELECT AVG(r.rating) AS rating, r.LinkIDFK2 FROM Reviews r INNER JOIN Traffic t ON r.LinkIDFK2 = t.LinkIDFK GROUP BY LinkIDFK2 ORDER BY rating DESC, t.Hits DESC Depending on your database you can usually limit the numer of results by using LIMIT or TOP.

Re:Need help with Query

2004-02-07 Thread Jake .
Jake. wrote: SELECT AVG(r.rating) AS rating, r.LinkIDFK2 FROM Reviews r INNER JOIN Traffic t ON r.LinkIDFK2 = t.LinkIDFK GROUP BY LinkIDFK2 ORDER BY rating DESC, t.Hits DESC Depending on your database you can usually limit the numer of results by using LIMIT

Need Help With Query

2003-03-05 Thread Eric Homa
Hi, I have a query that I need to use to search a text field in a table. The text strings that are in the table in this field sometimes include a pound sign (#). Whenever I the query is run using a variable that includes a pound sign it returns no records. Here is an abbreviated example of

Fw: Need Help With Query

2003-03-05 Thread Eric Homa
Please disregard my message as I have figured out my problem. Thanks, Eric Homa - Original Message - From: Eric Homa To: [EMAIL PROTECTED] Sent: Wednesday, March 05, 2003 1:49 PM Subject: Need Help With Query Hi, I have a query that I need to use to search a text field in a table

RE: Need Help With Query

2003-03-05 Thread Cantrell, Adam
. -Original Message- From: Eric Homa [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2003 3:50 PM To: CF-Talk Subject: Need Help With Query Hi, I have a query that I need to use to search a text field in a table. The text strings that are in the table in this field

Re: Help With Query

2002-04-01 Thread Dina Hess
Sent: Sunday, March 31, 2002 8:25 PM Subject: Re: Help With Query Can't pull out count for each individual FishID. I tried grouping using the Group attribute in CFQUERY and the grouping of course works, but all I'm missing is the SUM for each group. Is there a function to sum items

Re: Help With Query

2002-04-01 Thread Frank Mamone
Sorry. my mistake. I needed to change your t.id with my t.fishid. Many thanks for all your help. All this on April Fool's day! - Original Message - From: Dina Hess [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Monday, April 01, 2002 8:37 AM Subject: Re: Help With Query

Help With Query

2002-03-31 Thread Frank Mamone
I have a fish databse. One table contains a Fish Database called FishDB. The other stores the fish per tank FishINV. So if I add three of the same type of fish I get three records in FISHINV records. I did it this way so I can add and remove fish and keep details about each fish. They may have

Re: Help With Query

2002-03-31 Thread Dina Hess
, COUNT, etc. Hope that helps. Dina - Original Message - From: Frank Mamone To: CF-Talk Sent: Sunday, March 31, 2002 11:15 AM Subject: Help With Query I have a fish databse. One table contains a Fish Database called FishDB. The other stores the fish per tank FishINV. So

Re: Help With Query

2002-03-31 Thread Frank Mamone
answer. I'll take a closer look and see if it helps me. Frank - Original Message - From: Dina Hess [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Sunday, March 31, 2002 12:57 PM Subject: Re: Help With Query Frank, This definitely sounds kinda fishy. ;) So let's see...you've

Re: Help With Query

2002-03-31 Thread Dina Hess
Frank, Illuminate me. Just out of curiousity, what type of data might you store in the main and sub fish categories? Dina - Original Message - From: Frank Mamone To: CF-Talk Sent: Sunday, March 31, 2002 12:17 PM Subject: Re: Help With Query Hi Dina, This is what I

Re: Help With Query

2002-03-31 Thread Frank Mamone
PROTECTED] Sent: Sunday, March 31, 2002 1:25 PM Subject: Re: Help With Query Frank, Illuminate me. Just out of curiousity, what type of data might you store in the main and sub fish categories? Dina - Original Message - From: Frank Mamone To: CF-Talk Sent: Sunday, March

Re: Help With Query

2002-03-31 Thread Dina Hess
: Sunday, March 31, 2002 12:39 PM Subject: Re: Help With Query OK. Here's an example: FishDB Id CategoryID SubCategoryID SciName CommonName Comment 52 1 1 Anomalochromis thomasi African Butterfly Cichlid Id CategoryID SubCategoryID SciName CommonName Comment 25 1 1

Re: Help With Query

2002-03-31 Thread Dina Hess
). - Original Message - From: Dina Hess To: CF-Talk Sent: Sunday, March 31, 2002 1:53 PM Subject: Re: Help With Query Frank, Try this: SELECT count(t.id), f.CommonName, s.FishSubCategory FROM FishDB AS f, FishInv AS t, FishSubCategory AS s WHERE f.id=t.id And f.id

Re: Help With Query

2002-03-31 Thread Frank Mamone
] To: CF-Talk [EMAIL PROTECTED] Sent: Sunday, March 31, 2002 3:38 PM Subject: Re: Help With Query Whoops! You'll need to change that query slightly to pull your count out... First line should be: Select count(t.id) as FishCount,... And if you have a *lot* of fish in an MS Access db, you'll

Re: help w/ query

2001-12-01 Thread Dina Hess
SELECT com.typeID,...,SUM(com.sysPrice) AS Price,... - Original Message - From: Douglas L. Brown To: CF-Talk Sent: Friday, November 30, 2001 12:34 PM Subject: OT: help w/ query I have the following query that I need to get the sum of the sysPrice from. I keep getting

Re: help w/ query

2001-12-01 Thread Douglas L. Brown
Thanks Dina, I decided to use the ol query of query and bingo problem solved Doug - Original Message - From: Dina Hess [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Saturday, December 01, 2001 11:40 AM Subject: Re: help w/ query SELECT com.typeID,...,SUM(com.sysPrice

OT: help w/ query

2001-11-30 Thread Douglas L. Brown
I have the following query that I need to get the sum of the sysPrice from. I keep getting an the ol aggregate function or group by error, can someone help please? SELECT com.typeID, com.partNum, com.description, com.currentType, com.salePrice, com.sysPrice, parts.isDefault,

Re: OT: help w/ query

2001-11-30 Thread Jamie Jackson
I think every column in your SELECT statement must be present in your GROUP by clause (except for aggregate functions). Jamie On Fri, 30 Nov 2001 10:34:55 -0800, in cf-talk you wrote: I have the following query that I need to get the sum of the sysPrice from. I keep getting an the ol

Help with Query

2000-11-02 Thread Kelly Matthews
Ok I will lay this out best i can... I have a database I am dealing just with one small table. In that table we have: Auto_ID FirstName LastName SocialSecNum TestName TestDate If someone takes a test, we will use Driver Training as an example. They take the test and pass and their info is

RE: Help with Query

2000-11-02 Thread Jason Powers
Can't you say something like SELECT name, max(date) FROM table WHERE date@mydate-2years GROUP BY name Jason Powers Fig Leaf Software -Original Message- From: Kelly Matthews [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 02, 2000 11:51 AM To: CF-Talk Subject: Help with Query Ok

RE: Help with Query

2000-11-02 Thread Kelly Matthews
To: CF-Talk Subject: RE: Help with Query Can't you say something like SELECT name, max(date) FROM table WHERE date@mydate-2years GROUP BY name Jason Powers Fig Leaf Software -Original Message- From: Kelly Matthews [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 02

Still need Help with Query

2000-11-02 Thread Kelly Matthews
maybe you can shed some light got it to work by doing this: (there could be an easier way) This query finds all the distinct ssn's. CFQUERY DATASOURCE="#DSN#" name="search" SELECT DISTINCT ssn FROM STUDENTS WHERE AIRPORT_CODE = 'AAE' AND testname = 'Driver

RE: Still need Help with Query

2000-11-02 Thread Hayes, David
: Thursday, November 02, 2000 1:48 PM To: CF-Talk Subject: Still need Help with Query maybe you can shed some light got it to work by doing this: (there could be an easier way) This query finds all the distinct ssn's. CFQUERY DATASOURCE="#DSN#" name="search"

round 3: HELP with Query.

2000-08-10 Thread miles
1.) CFQUERY Name="Tech" DataSource="#DSNCCare#" select * from nxsteche where tech_code = '#tech#' /CFQUERY 2.) CFQUERY Name="CASES" DataSource="#DSNCCare#" SELECT DISTINCT nxstar_e.tar_num, nxstar_e.bus_name, nxstar_e.cust_code, nxstar_e.tar_status, Max(nxsprodr.prod_desc) AS prod_desc,

RE: round 3: HELP with Query.

2000-08-10 Thread Miguel
ra: [EMAIL PROTECTED] Asunto: round 3: HELP with Query. 1.) CFQUERY Name="Tech" DataSource="#DSNCCare#" select * from nxsteche where tech_code = '#tech#' /CFQUERY 2.) CFQUERY Name="CASES" DataSource="#DSNCCare#" SELECT DISTINCT nxstar

RE: round 3: HELP with Query.

2000-08-10 Thread miles
It seems that field "nxstar_e.assigned_to" is numeric type (like '#cookie.user_id#'), and '#tech' is char. Nope. Both are type char. -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe

round 2: help with query.

2000-08-09 Thread miles
1.) CFQUERY Name="Tech" DataSource="#DSNCCare#" select * from nxsteche where tech_code = '#tech#' /CFQUERY 2.) CFQUERY Name="CASES" DataSource="#DSNCCare#" SELECT DISTINCT nxstar_e.tar_num, nxstar_e.bus_name, nxstar_e.cust_code, nxstar_e.tar_status, Max(nxsprodr.prod_desc) AS prod_desc,

RE: Help w/ query display...

2000-07-21 Thread Anthony Geoghegan
|However doing this: |input type="checkbox" name="runway_id#runway_id#" |value="#runway_id#" CFIF |runway_ID IS "qgetrunwaydetail.runway_ID"CHECKED/CFIF#runway# | |Does not work. even though there are 2 runway Id's that are |pulled from the |runwaydetail query it only brings back one |in this

RE: Help with Query

2000-07-21 Thread Anthony Geoghegan
Hi Ben, Try SELECT Email FROM CustomerLeads WHERE CustomerLeads.Email ='#Email#' UNION SELECT Email FROM EuropeLeads WHERE EuropeLeads.Email ='#Email#' This or a variation on this should work. Regards, Anthony Geoghegan Lead Developer Ireland Film and Television Net 26 South Frederick Street

Help w/ query display...

2000-07-20 Thread Kelly Matthews
Ok I run these 2 queries: CFQUERY datasource="#dsn#" name="qgetrunways" SELECT * FROM Runways /CFQUERY CFQUERY datasource="#dsn#" name="qgetrunwaydetail" SELECT * FROM Runway_Detail WHERE O_Report_Num = #qgetops.O_Report_Num# /CFQUERY The first just pulls all the runways. The 2nd pulls any

RE: Help w/ query display...

2000-07-20 Thread Kelly Matthews
July 20, 2000 1:57 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Help w/ query display... Ok I run these 2 queries: CFQUERY datasource="#dsn#" name="qgetrunways" SELECT * FROM Runways /CFQUERY CFQUERY datasource="#dsn#" name="qge

RE: Help w/ query display...

2000-07-20 Thread Kelly Matthews
t Development Coordinator AAAE 703.578.2509 [EMAIL PROTECTED] http://www.airportnet.org --- -Original Message- From: Kelly Matthews [SMTP:[EMAIL PROTECTED]] Sent: Thursday, July 20, 2000 2:01 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE:

Re: Help w/ query display...

2000-07-20 Thread Matt Taylor
AS far as HTML is concerned the syntax for a CHECKED radio button or check box is; input type="radio" name="name" value="value" checked input type="checkbox" name="name" value="value" checked you have your 'checked' argument outside the tag...maybe a typo though. -Matt Ok I run these 2

Help with Query

2000-06-19 Thread Ben Densmore
This is a multi-part message in MIME format. --=_NextPart_000_00B7_01BFD9DB.5A513580 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I'm trying to do a query where I grab the date a user downloaded an eval = version of our software from

help with query

2000-04-17 Thread stäs
Guys, This gives me an error: cfquery name="GetRev" datasource="#application.database#" dbtype="ODBC" SELECT YEAR, QUARTER, REF_PERCENT, sum(PRICE) AS tot_price, sum(REF_RENUMERATION) AS tot_renum FROM ORDER_AFFILIATE WHERE AFF_ID = '#URL.RecordID#'

RE: help with query

2000-04-17 Thread Dave Watts
This gives me an error: cfquery name="GetRev" datasource="#application.database#" dbtype="ODBC" SELECT YEAR, QUARTER, REF_PERCENT, sum(PRICE) AS tot_price, sum(REF_RENUMERATION) AS tot_renum FROM ORDER_AFFILIATE WHERE AFF_ID =