I need to convert a value from a recordset "66-BB-33" in "66BB33" to put it in a file.
I already try to create functions using split() or replace(), but I always receive an error
message that "waiting object" for the value passed to function. Any help please. Thanks.

The code:
Code:
<% 	
	function formataData(d) {
		var strHoje = new Date(d);
		var strDia = strHoje.getDate(); 
			if (strDia < 10){ strDia = "0" + strDia }
		var strMes = strHoje.getMonth(); 
			strMes = strMes + 1;
				if (strMes < 10) { strMes = "0" + strMes }
		var strAno = strHoje.getYear();
		var DataHoje = strDia + "-" + strMes + "-" + strAno; 
	return DataHoje;
	}

	function separaM(matricula) {
		var vMat = Replace(matricula,"-","");
	return vMat;
	}

	var rs3 = Server.CreateObject("ADODB.Recordset");
 	strSQL3 = "Select * from Frota_consumo where UO= '" + vXu + "' order by x_matricula ASC, data_consumo DESC";
	rs3.Open (strSQL3, conn); 
	while (!rs3.EOF) { 
	
	vFile.WriteLine (separaM(rs3("x_matricula")) + ";" + formataData(rs3("data_consumo")) + ";" + rs3("contagem_anterior") + ";" + rs3("contagem_actual") + ";" + rs3("contagem_consumo") + ";" + rs3("litros_consumo") + ";" + rs3("custo_consumo"));

%>
The strange that I use a similar function to format a date value (formataData()) and this works fine.