handling money SQL and VB

C

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"
 
D

David Browne

cj said:
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
 
K

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.)
 
K

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.)
 

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

Top