query string in classic asp code to catch integer values
===

I have written below code piece that is supposed to search from DB based on two values 1. Integer value(ID of a SHIP) 2. String value(SHIP name).But with the code I have I am able to get data from the DB using the SHIP name i.e using the 2nd case. But unable to search the data using the ID of the SHIP.
Attaching the code piece below.Any help on these is highly appreciated.

		
	nIMO = sql_ship_friendly(request.querystring("nIMO"))
	if IsNumeric(nIMO) = false then
		nIMO = ""
	else
		nIMO = cInt(nIMO)
	end if

	sVessel = sql_ship_friendly(UCase(request.querystring("sVessel")),10)

	
	if not nIMO = "" then	
	
		'search based on vessel id


  

    sql = "SELECT IMO_NBR, VESSEL_NM, COALESCE(SHIP_TYP,'0') AS SHIP_TYP, COALESCE(DWT_WT, 0) AS DWT_WT, COALESCE(YEAR_BUILT_NBR, 0) AS YEAR_BUILT_NBR FROM RSP_VESSEL_VW WHERE ACTIVE_IND='Y' AND IMO_NBR = 7723948"
		Set db1 = Server.CreateObject("ADODB.Connection")
		db1.Open GV_VIEW_DB_String 
		Set rs = db1.Execute(sql)
		Set dbl = nothing "
		
	elseif not sVessel = "" then
	
		'search based on vessel number

      
    sql = "SELECT IMO_NBR, VESSEL_NM,  COALESCE(SHIP_TYP,'0') AS SHIP_TYP, COALESCE(DWT_WT, 0) AS DWT_WT, COALESCE(YEAR_BUILT_NBR , 0) AS YEAR_BUILT_NBR FROM RSP_VESSEL_VW WHERE VESSEL_NM LIKE '"&SVESSEL&"%' AND ACTIVE_IND='Y'"

   ' response.write sql
		Set db1 = Server.CreateObject("ADODB.Connection")
		db1.Open GV_VIEW_DB_String 
		Set rs = db1.Execute(sql)
		Set dbl = nothing 