Thank you Nick and Greg, you have given me some direction to go on and I really 
appreciate it. I have been "playing" with it for awhile longer and I am getting 
close but still not quite there.  (Note:  I added a table in the database 
called "returnAddress" that has the same record repeated 30 times - the return 
address.) This is what I have so far:



<cfquery name="qGetAddresses" datasource="xxx">
        SELECT fName, MI, lName, stName, aptNo, city, state, zipCode, classNo
        FROM students
        WHERE classNo = '#sectionName#'
</cfquery>

<cfset returnLabels = 30 - #qGetAddresses.recordCount#>

<cfquery name="qGetReturnAddresses" datasource="xxx" maxrows="#returnLabels#">
        SELECT fName, MI, lName, stName, aptNo, city, state, zipCode, classNo
        FROM returnAddress
        WHERE 0=0
</cfquery>



(So basically, I get the required records from the first query, and then I get 
a fixed amount of records from the second query  - the remaining 30 which are 
all the same, the return address)  Positive:  I am getting the records I need. 
Negative:  They are in two different queries.  I tried using a Union with the 
following code instead:



<cfquery name="QueryAppend" datasource="xxx" maxrows="30">
        SELECT fName, MI, lName, stName, aptNo, city, state, zipCode, classNo
        FROM students
        WHERE classNo = '#sectionName#'
                UNION ALL
        SELECT fName, MI, lName, stName, aptNo, city, state, zipCode, classNo
        FROM returnAddress
        WHERE 0=0
</cfquery>



This works almost perfectly.  Unfortunately, the "Maxrows" attribute has no 
effect.  If it did, I would be done.  With this Union query, I unfortunately 
get way more records than I need which is defeating the purpose.  I will keep 
working on it to see what I can do but if anyone has any suggestions or tips, 
that would be great! 

Thanks in advance!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
CF 8 – Scorpio beta now available, 
easily build great internet experiences – Try it now on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2889
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to