?
Solved

Type mismatch: 'cdec'

Posted on 2002-03-06
8
Medium Priority
?
1,603 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Expert Comment

by:loveneesh_bansal
ID: 6843877
hi

Cdec is only supported in visual basic not in asp.

Bye

loveneesh
0
 

Author Comment

by:sporfex
ID: 6843883
loveneesh,

What shall I use instead?
0
 
LVL 11

Accepted Solution

by:
thunderchicken earned 40 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

752 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