473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Determine type of Value

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
Jul 19 '05 #1
3 2572
Shahid Juma wrote:
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
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #2
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Shahid Juma wrote:
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
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #3
http://msdn.microsoft.com/library/de.../mdprotype.asp

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Shahid Juma" <sh*****************@hotmail.com> wrote in message
news:un**************@TK2MSFTNGP10.phx.gbl...
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Shahid Juma wrote:
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
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
2
by: bart plessers | last post by:
Hello, I have a form with some checkboxes, i.e. The default value of this checkbox is determined in a global file (config.asp), that is included in first line of the form, i.e. ShowFilenames...
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
3
by: JK | last post by:
This is an easy one, but I'm a JS newbie. I want to write a function that determines input value. If 0 - 100 than will use input as % (i.e., 3 would become .03 and used for calculations);...
3
by: Bob Day | last post by:
VS 2003, sql How do you determine the data type of a column if its value is DBNull? 1)Table: Column1 STRING non-nullable 2) Fill to a DataSet via DataAdapter 3) dim Data_Type_Is...
16
by: Jm | last post by:
Hi All Is it possible to determine who is logged onto a machine from inside a service using code in vb.net ? I have found some code that seems to work under vb6, but doesnt under .NET ? Any help...
14
by: Joseph Turian | last post by:
How can I determine the type of some particular typename? I am writing a template, and it needs special case handling for some particular types: template <typename T> class foo { public:...
1
by: tshad | last post by:
I have some code to go through a session collection for my error page routine and I get an error on my objects that I store in session variables. Dim strName as String Dim iLoop as Integer ...
5
by: mantrid | last post by:
Hello Im trying to find the correct syntax to use to determine whether which form element is visible on changing the value in a dropdown list I need something in the onChange of the dropdown...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.