you guys have really helped me out, thanks!!! i didnt even realise that i could do a query on a query. this will help tidy my code and business logic up no end. i am trying to do a combination of some of your suggestions as follows:
<--- this is the unique column array ---> <cfset uniqueColumnString = arraytolist(uniqueIdentifierArray,",")> <--- massImport is the name of the query ---> <cfset sqlQuery = "select distinct " & uniqueColumnString & " from massImport"> <--- then simply run the query ---> <cfquery name="getUniqueColumns" dbtype="query"> <cfoutput>#sqlQuery#</cfoutput> </cfquery> i have tried various tests with the query on query and overall it is working fine except when i put the distinct part on the query it produces an error saying: java.lang.Long cannot be cast to java.lang.String however if i run a similar piece of code in mysql, it works fine. can anyone see what i have done wrong thanks again for your help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:300126 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

