pkb_fk_ticketNo shouldn't have been replaced:
I notice that you have serialnum in both queries, but they're not set correctly. Set serialnum to the correct value in both loops.
Code:
<cfquery name="countserials" datasource="CustomerSupport"> SELECT COUNT(*) as serialcount from dbo.tbl_CS_serial where pkb_fk_ticketNo=<cfqueryparam value="Form.pk_ticketID#"> </cfquery>
Comment