Home All Groups Group Topic Archive Search About

handling money SQL and VB

Author
20 Jul 2006 6:40 PM
cj
I have a comma delimited file with 2 numeric columns.  The first is just
a decimal number that seems to have a max of 1 decimal place.  The last
column is money BUT very tiny increments of money.  Note all this is
included as text in the CSV file.  I plan to read this csv file into a
SQL 2000 DB using VB 2003.  What data type should I use in the SQL DB?
What data type should the variables be in VB?  I will be adding and
subtracting these numbers.  Thanks!

"SACRAMENTO,CA","1.5",".048"
"CARROLLTON,GA","21.5",".165"
"LAUREL    ,MD",".3",".273"
"MONTGOMERY,AL","1","0"
"HARRISONBG,VA",".3","0"

Author
20 Jul 2006 7:02 PM
David Browne
Show quote Hide quote
"cj" <cj@nospam.nospam> wrote in message
news:uTne%23vCrGHA.3380@TK2MSFTNGP04.phx.gbl...
>I have a comma delimited file with 2 numeric columns.  The first is just a
>decimal number that seems to have a max of 1 decimal place.  The last
>column is money BUT very tiny increments of money.  Note all this is
>included as text in the CSV file.  I plan to read this csv file into a SQL
>2000 DB using VB 2003.  What data type should I use in the SQL DB? What
>data type should the variables be in VB?  I will be adding and subtracting
>these numbers.  Thanks!
>
> "SACRAMENTO,CA","1.5",".048"
> "CARROLLTON,GA","21.5",".165"
> "LAUREL    ,MD",".3",".273"
> "MONTGOMERY,AL","1","0"
> "HARRISONBG,VA",".3","0"

Decimal.

David
Author
21 Jul 2006 1:04 AM
Kevin Yu [MSFT]
Hi cj,

I agree with David that we can use Decimal type in SQL DB. Also, this will
map to System.Decimal in .NET framework.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Author
21 Jul 2006 12:54 PM
cj
How would decimal differ from double?

Kevin Yu [MSFT] wrote:
Show quoteHide quote
> Hi cj,
>
> I agree with David that we can use Decimal type in SQL DB. Also, this will
> map to System.Decimal in .NET framework.
>
> Kevin Yu
> Microsoft Online Community Support
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================
>
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
Author
21 Jul 2006 1:02 PM
David Browne
"cj" <cj@nospam.nospam> wrote in message
news:e1QROTMrGHA.3996@TK2MSFTNGP04.phx.gbl...
> How would decimal differ from double?
>

Binary floating point and .NET
http://www.skeet.org.uk/csharp/floatingpoint.html

Decimal floating point in .NET
http://www.skeet.org.uk/csharp/decimal.html

David
Author
21 Jul 2006 1:48 PM
cj
Thanks.

David Browne wrote:
Show quoteHide quote
> "cj" <cj@nospam.nospam> wrote in message
> news:e1QROTMrGHA.3996@TK2MSFTNGP04.phx.gbl...
>> How would decimal differ from double?
>>
>
> Binary floating point and .NET
> http://www.skeet.org.uk/csharp/floatingpoint.html
>
> Decimal floating point in .NET
> http://www.skeet.org.uk/csharp/decimal.html
>
> David
>
>
Author
24 Jul 2006 3:04 AM
Kevin Yu [MSFT]
Hi cj,

Double type is a Floating-Point number. So it may lose precision. The
following article may also be helpful.

http://msdn2.microsoft.com/en-us/library/c151dt3s.aspx

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)