L
Lakrom
Hi to all
this is a Data Base in SQL Server 2000 in page cartola.asp
Good previously it asks for the date format where I only want the month in a
consultation SQL and the solution is this: f=month(date) Seth
xRs=pCon.Execute("SELECT sum(monto_abono) ace TPtosM FROM abono_gte WHERE
rutgte='"&session("rut")&"' AND month(fecha)="&f&"") but I have this
consultation in the following function:
Function TotalPuntosMes()
'// Back all point in month on curse
f= month(date)
Set pCon=server.CreateObject("adodb.connection")
pCon.Open application("StrConRuta")
Set xRs=pCon.Execute("SELECT sum(monto_abono) as TPtosM FROM abono_gte
WHERE rutgte='"&session("rut")&"' AND month(fecha)="&f&"")
If not xRs.Eof then
TotalPuntosMes=FormatNumber(xRs("TPtosM"),0,,,-2)
End if
pCon.Close
SET Pcon=Nothing
End Function
But this it throws the error to me of do not agree the types with
FormatNumber(), first think that the error is so that the field
xRs("TPtosM") null or empty can have value, but it is not the case. it is
not happened to me that it can be. I thank for of heart an aid. Thanks.
this is a Data Base in SQL Server 2000 in page cartola.asp
Good previously it asks for the date format where I only want the month in a
consultation SQL and the solution is this: f=month(date) Seth
xRs=pCon.Execute("SELECT sum(monto_abono) ace TPtosM FROM abono_gte WHERE
rutgte='"&session("rut")&"' AND month(fecha)="&f&"") but I have this
consultation in the following function:
Function TotalPuntosMes()
'// Back all point in month on curse
f= month(date)
Set pCon=server.CreateObject("adodb.connection")
pCon.Open application("StrConRuta")
Set xRs=pCon.Execute("SELECT sum(monto_abono) as TPtosM FROM abono_gte
WHERE rutgte='"&session("rut")&"' AND month(fecha)="&f&"")
If not xRs.Eof then
TotalPuntosMes=FormatNumber(xRs("TPtosM"),0,,,-2)
End if
pCon.Close
SET Pcon=Nothing
End Function
But this it throws the error to me of do not agree the types with
FormatNumber(), first think that the error is so that the field
xRs("TPtosM") null or empty can have value, but it is not the case. it is
not happened to me that it can be. I thank for of heart an aid. Thanks.