469,312 Members | 2,493 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,312 developers. It's quick & easy.

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 1443
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
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.