Link to home
Start Free TrialLog in
Avatar of sporfex
sporfex

asked on

Type mismatch: 'cdec'

Hi.

Type mismatch: 'cdec'

Here is the code:
ProductId = 262555561
OpLocationId = 2
InternalTime = trim(Request.Form("InsertInternalTime"))
InternalYield = trim(Request.Form("InsertInternalYield"))
CustomerTime = trim(request.Form("InsertCustomerTime"))
CustomerYield =trim(Request.Form("InsertCustomerYield"))
EditedTime =  Now()


if isnumeric(InternalTime) or isnumeric(InternalYield) or isnumeric(CustomerTime) or isnumeric(CustomerYield) then
  InternalTime = cdec(InternalTime)
  InternalYield = cdec(InternalYield)
  CustomerTime = cdec(CustomerTime)
  CustomerYield = cdec(CustomerYield)  
else
  'it isn't numeric
end if

remoteconn.execute "INSERT OpRegister (ProductId, OpLocationId, InternalTime, InternalYield, CustomerTime, CustomerYield, EditedDate) VALUES ('" & ProductId & "','" & OpLocationId & "'," & InternalTime & " ,'" & InternalYield & "','" & CustomerTime & "','" & CustomerYield & "','" & EditedDate & "')"


Why error?
Avatar of ruperts
ruperts

if isnumeric(InternalTime) and isnumeric(InternalYield) and isnumeric(CustomerTime) and isnumeric(CustomerYield)
then
 InternalTime = clng(InternalTime)
 InternalYield = clng(InternalYield)
 CustomerTime = clng(CustomerTime)
 CustomerYield = clng(CustomerYield)  
else
 'it isn't numeric
end if
Avatar of sporfex

ASKER

But I recive error if is just use (below) also:

if isnumeric(InternalTime) then

InternalTime = clng(InternalTime)

else
'it isn't numeric
end if

Type mismatch: 'cdec'
/operationsregister/insert.inc, line 35

That is this line : InternalTime = clng(InternalTime)
Avatar of sporfex

ASKER

Sorry, error is this line (the other was messed up for some reason):  InternalTime = cdec(InternalTime)
hi

Cdec is only supported in visual basic not in asp.

Bye

loveneesh
Avatar of sporfex

ASKER

loveneesh,

What shall I use instead?
ASKER CERTIFIED SOLUTION
Avatar of thunderchicken
thunderchicken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sporfex

ASKER

This was much. How should I implement that? I'm lost. You know I'm not an educated programmer. I just puzzle things together and get it to work. Sometimes..
i.e.  Use cdbl instead of cdec