- see footer for list info -<
well, you could always use UNION to combine them in the query itself

SELECT mobileNumber, 1 AS commType
FROM smsTable
WHERE blah = blah
UNION
SELECT mobileNumber, 2 AS commType
FROM voiceTable
WHERE bleargh = bleargh
ORDER BY commType ASC

or if there's something preventing you from doing this, you can add the rows
of query 2 to query 1

<cfscript>
arrCommType = arraynew(1);
arrayresize(arrCommType,qrySMS.recordcount);
//set commType to 1 to denote SMS, not voice
arraySet(arrCommType,1,qrySMS.recordcount,1);
//add array to query as new column
queryaddcolumn(qrySMS, "commType", arrCommType);
//now loop over qryVoice and add its rows to qrySMS
for (i=1;i lte qryVoice.recordcount;i=i+1) {
           queryaddrow(qrySMS);
           querysetcell(qrySMS,"mobileNumber",qryVoice.mobileNumber[i]);
           querysetcell(qrySMS,"commType",2);
}
</cfscript>

I'd go for the UNION query though. As long as your fields are the same in
both queries.

Rich

On 12/17/06, Lee Fortnam <[EMAIL PROTECTED]> wrote:

>- see footer for list info -<
Firstly,

Will apologies for typing this email after returning from a night out,
however, something has been annoying me.

I have 2 similar queries that return records from tables which differ
slightly depending on whether something is voice or SMS based.

Anyway, currently I run 1 query for the SMS info and 1 query for the voice
info. At present these are displayed in 2 tables, I now need to combine
the
results in 1 table based on the results of both queries.

Both queries have the same result fields but need to rank them
accordingly.
Dare say it is something to do with query of queries etc but brain dead at
mo!

Regards,

Lee Fortnam


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help
-<

_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to