Task 2: Assuming @SerialID holds the serial id in question,
SELECT Bin_ID, Serial_ID, Bin_Quantity FROM BinD WHERE EXISTS (SELECT BinD_ID FROM BinD bd2 WHERE bd2.transactionID > BinD.transactionID) Does this do what you want? Dominic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:296289 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4