Determine type of Value

S

Shahid Juma

Hello All,

This may be a trivial question, but I was wondering how can you determine if
a value contains an Integer or Float. I know there is a function called
IsNumeric, however you can't determine what type it is.

Thanks for the help,
Shahid
 
B

Bob Barrows [MVP]

Shahid said:
Hello All,

This may be a trivial question, but I was wondering how can you
determine if a value contains an Integer or Float. I know there is a
function called IsNumeric, however you can't determine what type it
is.

Thanks for the help,
Shahid

If Int(val) = val then
'It's an integer
Else
'It's a float
End if

Bob Barrows
 
S

Shahid Juma

Thanks,

A follow up to this question. How can you determine what type of variable it
is from the record set. If you have a query that looks at a table in SQL
Server. How can you tell that a certain field is varchar, bigint, int, etc?
The reason for asking is that I need to know what type of variable it is and
sometimes these fields are empty so using the value to determine what type
won't work every time.

Thanks,
Shahid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top