Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Gtting error message Microsoft VBScript runtime (0x800A000D) Type mismatch

Posted on 2009-05-12
5
Medium Priority
?
298 Views
Last Modified: 2012-05-06
Hi,
I have few calculations on my ASP page and when I use to run the page I am getting the error message. I code generates the total number of cases done from the sum of a numeric field operator and another code generates the sum oftime diffrence between the start and end time in second. When on next line which is used to generate the average handle time(AHT) by dividing the time diffrence with the total number of case then I am getting the error message. I am enclosing the code for all three steps.
Steps to generate number of cases:-
Select Sum(cases) as IntTotal51 from prsmic_master where prsmic_master.UserID='"&UserID&"' and prsmic_master.Inputdate>='"&fdate&"' and prsmic_master.Inputdate<='"&tdate&"' and prsmic_master.Uploaddate>='"&fdate&"' and prsmic_master.Uploaddate<='"&tdate&"' and prsmic_master.Status="&t1&"
output of this is stored in a variable Product68
Steps to generate total time spent on doing these cases:-
Select sum(datediff(s,(Starttime),(Endtime))) AS Prod from PrSmic_master where UserID="&UserID&" and prsmic_master.Inputdate>='"&fdate&"' and prsmic_master.Inputdate<='"&tdate&"' and prsmic_master.Uploaddate>='"&fdate&"' and prsmic_master.Uploaddate<='"&tdate&"' and (contactid in(select distinct groupid from PrSmic_master where groupid is not null) or id in(select distinct groupid from PrSmic_master where groupid is not null))
output of this is stored in a variable prhr13
Calcualtion of AHT:-
Aht1=prhr13/Product68

Open in new window

0
Comment
Question by:rohit_jha7
  • 3
  • 2
5 Comments
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 24371586
you are getting the error on this line correct?
>>   Aht1=prhr13/Product68
What is   [ Aht1 ]
Is it a Number Field? If it is, then you have a / that is generating the error.
If you need to have these numbers inserted into the Field, then you will need to change
It Type from [Numbers] to [Text] in your database.

If I am incorrect in my assumption, please explain a little more about the issue.
Carrzkiss
0
 

Author Comment

by:rohit_jha7
ID: 24381522
AHT1 is a numeric field. Also the output stored on the Product68 from the sum(cases), where the cases field is numeric data type.
0
 
LVL 31

Expert Comment

by:Wayne Barron
ID: 24383288
Aht1 -- Number Field
prhr13/Product68  --   This is a string (Text)

You are receiving the error, because you are trying to pass a Text-String into a Number Field.
If you are going to be needing to send this type of Data over to the field.
Then change this Fields [Data Type = Text] instead of [Data Type = Number]
And you will see that it works without issue now.
If it needs to remain as a [Data Type = Number] Then I suggest that you send "Numerical" Values
To the field instead of "Text" Values.

Let me know if you still have problems.
Carrzkiss
0
 

Author Comment

by:rohit_jha7
ID: 24397385
Issue resolved after handling the Null value error by using the IsNull error handling
0
 
LVL 31

Accepted Solution

by:
Wayne Barron earned 2000 total points
ID: 24397560
strange.
>> Aht1=prhr13/Product68
This would cause the error as well, as it is not a Number that is being passed, but Text String.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

885 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