Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Old 06-05-2012, 10:47 AM Type Mismatch: Error
Junior Talker

Posts: 2
Trades: 0
Hello,
I'm getting an error that just recently started when trying to input decimals into a form. It works fine with whole numbers but decimals give this error. Any help would be greatly appreciated.

Microsoft VBScript runtime error '800a000d'
Type mismatch: 'TotalAbsences'
updater.asp, line 155

Line 155 is "if TotalAbsences <> 0 then"
If more code is needed please let me know.

Code:
if Request.Form("Class") = "RW" then
    if TotalAbsences <> 0 then
    rstemp("RWAbsences") = rstemp("RWAbsences")+Request.Form(Mabsences)+Request.Form(Tabsences)+Request.Form(Wabsences)+Request.Form(Rabsences)+Request.Form(Fabsences)
    rstemp("RWAbsenceDates") = rstemp("RWAbsenceDates") & "<u>Week" & Request.Form("Week") & "</u>: <nobr>" & Request.Form(Mabsences)& "-" & Request.Form(Tabsences)&"-" &Request.Form(Wabsences)&"-" &Request.Form(Rabsences)&"-" &Request.Form(Fabsences) & "</nobr>"& "<br>"
    end if
    if TotalTardies <> 0 then    
    rstemp("RWTardies") = rstemp("RWTardies")+Request.Form(Mtardies)+Request.Form(Ttardies)+Request.Form(Wtardies)+Request.Form(Rtardies)+Request.Form(Ftardies)
    rstemp("RWTardyDates") = rstemp("RWTardyDates") & "<u>Week" & Request.Form("Week") & "</u>: <nobr>" & Request.Form(Mtardies) & "-" & Request.Form(Ttardies)&"-" &Request.Form(Wtardies)&"-" &Request.Form(Rtardies)&"-" &Request.Form(Ftardies)& "</nobr>"& "<br>"
    end if
rstemp.Update
Response.Write "<i>" & rstemp("FirstName") & " " & rstemp("LastName") & "</i> " & "now has <b>" & rstemp("RWAbsences") & "</b> total absences and <b>" & rstemp("RWTardies") & "</b> total tardies in this class.<br>"
end if
doubble07 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-05-2012, 03:30 PM Re: Type Mismatch: Error
chrishirst's Avatar
Defies a Status

Posts: 44,052
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Cast the form value, which is a string, to a numeric value.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-06-2012, 10:10 AM Re: Type Mismatch: Error
Junior Talker

Posts: 2
Trades: 0
Im new to coding could you explain a little more please. Also this is for attendance and I found out that it will add a decimal fine, but since im inputting attendance for the week if I put more than one in the week is when I get the error. Ex. Monday 2.5 Tuesday 2.5 it adds them together and I get the error. If I just put in Monday 2.5 it will work.


Thanks

Last edited by doubble07; 06-06-2012 at 10:46 AM..
doubble07 is offline
Reply With Quote
View Public Profile
 
Old 06-06-2012, 02:37 PM Re: Type Mismatch: Error
chrishirst's Avatar
Defies a Status

Posts: 44,052
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
RTFM.

http://msdn.microsoft.com/en-us/library/sf1aw27b.aspx
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-06-2012, 08:38 PM Re: Type Mismatch: Error
Physicsguy's Avatar
404 - Title not found

Posts: 1,066
Name: Scott Kaye
Location: Ontario
Trades: 0
Coming from C#, this sound like you're trying to set a double into an integer. All I've looked at is this, so are you using adInteger instead of adDouble for your data type? (Edit, looks like I'm a moron, but I'll keep this here anyway)

C# example:

Code:
int variable;
variable = 4; //works
variable = 5.2; //doesn't work, but

double variable
variable = 5.2; //works
__________________

Please login or register to view this content. Registration is FREE

Last edited by Physicsguy; 06-06-2012 at 08:39 PM..
Physicsguy is online now
Reply With Quote
View Public Profile Visit Physicsguy's homepage!
 
Old 08-23-2012, 06:24 AM Re: Type Mismatch: Error
Junior Talker

Posts: 1
Trades: 0
Define the double variable instead of int then it work
MaheshDarkunde23 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Type Mismatch: Error
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18150 seconds with 11 queries