Solved

Type mismatch: 'cdec'

Posted on 2002-03-06
8
1,497 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
Comment Utility
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
Comment Utility
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
Comment Utility
Sorry, error is this line (the other was messed up for some reason):  InternalTime = cdec(InternalTime)
0
 
LVL 1

Expert Comment

by:loveneesh_bansal
Comment Utility
hi

Cdec is only supported in visual basic not in asp.

Bye

loveneesh
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:sporfex
Comment Utility
loveneesh,

What shall I use instead?
0
 
LVL 11

Accepted Solution

by:
thunderchicken earned 10 total points
Comment Utility
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
Comment Utility
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
Comment Utility
i.e.  Use cdbl instead of cdec
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

13 Experts available now in Live!

Get 1:1 Help Now