Solved

Type mismatch: 'cdec'

Posted on 2002-03-06
8
1,514 Views
Last Modified: 2008-03-03
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?
0
Comment
Question by:sporfex
8 Comments
 
LVL 4

Expert Comment

by:ruperts
ID: 6843845
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
0
 

Author Comment

by:sporfex
ID: 6843850
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)
0
 

Author Comment

by:sporfex
ID: 6843853
Sorry, error is this line (the other was messed up for some reason):  InternalTime = cdec(InternalTime)
0
 
LVL 1

Expert Comment

by:loveneesh_bansal
ID: 6843877
hi

Cdec is only supported in visual basic not in asp.

Bye

loveneesh
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:sporfex
ID: 6843883
loveneesh,

What shall I use instead?
0
 
LVL 11

Accepted Solution

by:
thunderchicken earned 10 total points
ID: 6844000
My appologies via the last thread

CDbl Function
See Also
CBool Function | CByte Function | CCur Function | CDate Function | CInt Function | CLng Function | CSng Function | CStr Function
Requirements
Version 1
Returns an expression that has been converted to a Variant of subtype Double.

CDbl(expression)
The expression argument is any valid expression.

Remarks
In general, you can document your code using the subtype conversion functions to show that the result of some operation should be expressed as a particular data type rather than the default data type. For example, use CDbl or CSng to force double-precision or single-precision arithmetic in cases where currency or integer arithmetic normally would occur.

Use the CDbl function to provide internationally aware conversions from any other data type to a Double subtype. For example, different decimal separators and thousands separators are properly recognized depending on the locale setting of your system.

This example uses the CDbl function to convert an expression to a Double.

Dim MyCurr, MyDouble
MyCurr = CCur(234.456784)              ' MyCurr is a Currency (234.4567).
MyDouble = CDbl(MyCurr * 8.2 * 0.01)   ' Convert result to a Double (19.2254576).
Requirements
Version 1

These also will work in VBScript:

CBool Function | CByte Function | CCur Function | CDate Function | CInt Function | CLng Function | CSng Function | CStr Function
0
 

Author Comment

by:sporfex
ID: 6844057
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..
0
 
LVL 2

Expert Comment

by:damienm
ID: 6844197
i.e.  Use cdbl instead of cdec
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Classic ASP - cannot find folder on the server 5 31
Help with stored procedure 30 59
How to update a dummy recordset with classic ASP 4 66
ASP Button to clear text 4 44
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now