I am getting this type mismatch error and not sure why?!
The last line is the one causing the error... I am trying to get those
values from an Oracle database and add/subtract their values.

<% InAcademic =rsDataSet("In_Academic")
InNonAcademic =rsDataSet("In_Non_Academic")
FinancialAid =rsDataSet("Financial_Aid")
%>
<% AmountDue = InAcademic + InNonAcademic - FinancialAid %>

Re: Type mismatch - Microsoft VBScript runtime error '800a000d' by Stefan

Stefan
Mon Oct 24 09:37:39 CDT 2005

Are you sure all 3 fields are at least an integer field and none of them can ever be empty or null
- or try to force a conversion to Integer using Cint

InAcademic =Cint(rsDataSet("In_Academic"))


Check them (where "var" is your actual variable name - say "FinancialAid") with either
Response.write TypeName("var")
or
Response.write VarType("var")

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________


"Red_Star20" <RedStar20@discussions.microsoft.com> wrote in message news:3788BFFA-0570-4C96-BDE0-79572C46BC35@microsoft.com...
|I am getting this type mismatch error and not sure why?!
| The last line is the one causing the error... I am trying to get those
| values from an Oracle database and add/subtract their values.
|
| <% InAcademic =rsDataSet("In_Academic")
| InNonAcademic =rsDataSet("In_Non_Academic")
| FinancialAid =rsDataSet("Financial_Aid")
| %>
| <% AmountDue = InAcademic + InNonAcademic - FinancialAid %>
|



RE: Type mismatch - Microsoft VBScript runtime error '800a000d' by RedStar20

RedStar20
Mon Oct 24 10:32:25 CDT 2005

You were right, but instead of using CInt I have to use CLng for decimals.
What if however some of the fields are empty... How can I handle them? Using
the CLng gives me an error in case of empty fields. Any ideas?

"Red_Star20" wrote:

> I am getting this type mismatch error and not sure why?!
> The last line is the one causing the error... I am trying to get those
> values from an Oracle database and add/subtract their values.
>
> <% InAcademic =rsDataSet("In_Academic")
> InNonAcademic =rsDataSet("In_Non_Academic")
> FinancialAid =rsDataSet("Financial_Aid")
> %>
> <% AmountDue = InAcademic + InNonAcademic - FinancialAid %>
>

Re: Type mismatch - Microsoft VBScript runtime error '800a000d' by Kevin

Kevin
Mon Oct 24 11:05:16 CDT 2005

If IsNull(rsDataSet("In_Academic").Value) Then
InAcademic = 0
Else
InAcademic = rsDataSet("InAcademic").Value
end If

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.

"Red_Star20" <RedStar20@discussions.microsoft.com> wrote in message
news:FBAFBC30-11F1-423B-9FAC-659001CA514D@microsoft.com...
> You were right, but instead of using CInt I have to use CLng for decimals.
> What if however some of the fields are empty... How can I handle them?
> Using
> the CLng gives me an error in case of empty fields. Any ideas?
>
> "Red_Star20" wrote:
>
>> I am getting this type mismatch error and not sure why?!
>> The last line is the one causing the error... I am trying to get those
>> values from an Oracle database and add/subtract their values.
>>
>> <% InAcademic =rsDataSet("In_Academic")
>> InNonAcademic =rsDataSet("In_Non_Academic")
>> FinancialAid =rsDataSet("Financial_Aid")
>> %>
>> <% AmountDue = InAcademic + InNonAcademic - FinancialAid %>
>>



Re: Type mismatch - Microsoft VBScript runtime error '800a000d' by RedStar20

RedStar20
Mon Oct 24 11:13:04 CDT 2005

I guess that works, I just thought there was a different way of doing it too..
Thanks

"Kevin Spencer" wrote:

> If IsNull(rsDataSet("In_Academic").Value) Then
> InAcademic = 0
> Else
> InAcademic = rsDataSet("InAcademic").Value
> end If
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> A watched clock never boils.
>
> "Red_Star20" <RedStar20@discussions.microsoft.com> wrote in message
> news:FBAFBC30-11F1-423B-9FAC-659001CA514D@microsoft.com...
> > You were right, but instead of using CInt I have to use CLng for decimals.
> > What if however some of the fields are empty... How can I handle them?
> > Using
> > the CLng gives me an error in case of empty fields. Any ideas?
> >
> > "Red_Star20" wrote:
> >
> >> I am getting this type mismatch error and not sure why?!
> >> The last line is the one causing the error... I am trying to get those
> >> values from an Oracle database and add/subtract their values.
> >>
> >> <% InAcademic =rsDataSet("In_Academic")
> >> InNonAcademic =rsDataSet("In_Non_Academic")
> >> FinancialAid =rsDataSet("Financial_Aid")
> >> %>
> >> <% AmountDue = InAcademic + InNonAcademic - FinancialAid %>
> >>
>
>
>

Re: Type mismatch - Microsoft VBScript runtime error '800a000d' by Conrad

Conrad
Tue Oct 25 16:15:01 CDT 2005

You can also check to see if what you are trying to convert is a number.

If IsNumeric(rs("Field")) Then


"Red_Star20" wrote:

> I guess that works, I just thought there was a different way of doing it too..
> Thanks
>
> "Kevin Spencer" wrote:
>
> > If IsNull(rsDataSet("In_Academic").Value) Then
> > InAcademic = 0
> > Else
> > InAcademic = rsDataSet("InAcademic").Value
> > end If
> >
> > --
> > HTH,
> >
> > Kevin Spencer
> > Microsoft MVP
> > ..Net Developer
> > A watched clock never boils.
> >
> > "Red_Star20" <RedStar20@discussions.microsoft.com> wrote in message
> > news:FBAFBC30-11F1-423B-9FAC-659001CA514D@microsoft.com...
> > > You were right, but instead of using CInt I have to use CLng for decimals.
> > > What if however some of the fields are empty... How can I handle them?
> > > Using
> > > the CLng gives me an error in case of empty fields. Any ideas?
> > >
> > > "Red_Star20" wrote:
> > >
> > >> I am getting this type mismatch error and not sure why?!
> > >> The last line is the one causing the error... I am trying to get those
> > >> values from an Oracle database and add/subtract their values.
> > >>
> > >> <% InAcademic =rsDataSet("In_Academic")
> > >> InNonAcademic =rsDataSet("In_Non_Academic")
> > >> FinancialAid =rsDataSet("Financial_Aid")
> > >> %>
> > >> <% AmountDue = InAcademic + InNonAcademic - FinancialAid %>
> > >>
> >
> >
> >