471,829 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,829 software developers and data experts.

type mismatch retrieving result set

The following statement will give me type mismatch error.
interest = rs("CURR_WORKING_INTEREST")
if interest<>0 then ...

But, the following statement will not give me type mismatch error.
interest = round(rs("CURR_WORKING_INTEREST"))
if interest<>0 then ...
I can't use round all the time because result set will be null value.

How to handle this? Thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
3 1494
are you sure that rs("CURR_WORKING_INTEREST") isnt null?
What datatype is it?
Have you tried a CInt() CDbl() etc?

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"eddie wang" <ew***@kmg.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
The following statement will give me type mismatch error.
interest = rs("CURR_WORKING_INTEREST")
if interest<>0 then ...

But, the following statement will not give me type mismatch error.
interest = round(rs("CURR_WORKING_INTEREST"))
if interest<>0 then ...
I can't use round all the time because result set will be null value.

How to handle this? Thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2
Dim interest
interest = rs.Fields.Item("CURR_WORKING_INTEREST").Value
If IsNull(interest) Then
interest = 0 ''or whatever value you'd like
Else
interest = Round(interest)
End If

Also read here: http://www.aspfaq.com/show.asp?id=2073

Ray at work
"eddie wang" <ew***@kmg.com> wrote in message
news:uc**************@TK2MSFTNGP09.phx.gbl...
The following statement will give me type mismatch error.
interest = rs("CURR_WORKING_INTEREST")
if interest<>0 then ...

But, the following statement will not give me type mismatch error.
interest = round(rs("CURR_WORKING_INTEREST"))
if interest<>0 then ...
I can't use round all the time because result set will be null value.

How to handle this? Thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #3
Thanks for the logic. It works great!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by LJgrnl | last post: by
22 posts views Thread by Ruben | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.