Link to home
Start Free TrialLog in
Avatar of rohit_jha7
rohit_jha7Flag for India

asked on

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

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

Avatar of Wayne Barron
Wayne Barron
Flag of United States of America image

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
Avatar of rohit_jha7

ASKER

AHT1 is a numeric field. Also the output stored on the Product68 from the sum(cases), where the cases field is numeric data type.
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
Issue resolved after handling the Null value error by using the IsNull error handling
ASKER CERTIFIED SOLUTION
Avatar of Wayne Barron
Wayne Barron
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial