473,787 Members | 2,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

handling money SQL and VB

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",".16 5"
"LAUREL ,MD",".3",".273 "
"MONTGOMERY,AL" ,"1","0"
"HARRISONBG,VA" ,".3","0"
Jul 20 '06 #1
6 2822

"cj" <cj@nospam.nosp amwrote in message
news:uT******** ********@TK2MSF TNGP04.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",".16 5"
"LAUREL ,MD",".3",".273 "
"MONTGOMERY,AL" ,"1","0"
"HARRISONBG,VA" ,".3","0"
Decimal.

David
Jul 20 '06 #2
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/subscripti...ult.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/subscripti...t/default.aspx.
=============== =============== =============== =====

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

Jul 21 '06 #3
cj
How would decimal differ from double?

Kevin Yu [MSFT] wrote:
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/subscripti...ult.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/subscripti...t/default.aspx.
=============== =============== =============== =====

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Jul 21 '06 #4

"cj" <cj@nospam.nosp amwrote in message
news:e1******** ******@TK2MSFTN GP04.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
Jul 21 '06 #5
cj
Thanks.

David Browne wrote:
"cj" <cj@nospam.nosp amwrote in message
news:e1******** ******@TK2MSFTN GP04.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

Jul 21 '06 #6
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/subscripti...ult.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/subscripti...t/default.aspx.
=============== =============== =============== =====

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

Jul 24 '06 #7

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

Similar topics

5
7571
by: Bill Loren | last post by:
Hello ppl, I'm having difficulties to accomplish some simple chores with binary data. I'm having a string (?) which I received via an HTTP transactions which is a binary file. Problem is the webserver I'm communicating with injected a \x0D before every \x0A, and I need to remove those 0x0D characters from my buffer before saving it to disk.
24
3530
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing the code. Thank you. .. Facundo
41
1958
by: Jordan | last post by:
While writing some code, I realized I had never developed a consistent pattern for checking errors from a method. I have two styles I jump back and forth between, but I'm wondering which is better. Scenario: * In method that returns success/fail * Call method that also returns success/fail * Need to check return state and continue or exit outer method I personally think Case 1 looks a little cleaner but it breaks more
44
9499
by: Kulgan | last post by:
Hi I am struggling to find definitive information on how IE 5.5, 6 and 7 handle character input (I am happy with the display of text). I have two main questions: 1. Does IE automaticall convert text input in HTML forms from the
7
1686
by: Jason Kester | last post by:
Best I can tell, there are three basic ways you can deal with global error handling in ASP.NET. Namely: 1. Derive all your pages from a custom Page class, and override OnError() 2. Specify a custom 500 handler in Web.Config 3. Specify a custom 500 handler in IIS
94
3260
by: Chad | last post by:
On to top of page 163 in the book "The C Programming Langauge" by K & R, they have the following: char *strdup(char *s) { char *p; p=(char *)malloc(strlen(s)+1); if( p != NULL) strcpy(p,s): return p;
7
2985
KoreyAusTex
by: KoreyAusTex | last post by:
I am having a very hard time making this program work right, I am sort of lost and I was wondering if I might get some advice. This is what I have so far but I have a rounding error when I use the amount 10.03: public class Money { public static void main(String args) { double TOTAL_AMOUNT = 10.03;
4
13136
by: gamaz | last post by:
Hi, I am trying to work on a stored procedure that will work with multiple database. I have a prototype of multiple databases. Those are named as the following: ts2_aldkm_app, ts2_aldkp_app, ts2_aldkt_app. The middle part of the database name corresponds to the site name e.g aldkm corresponds to site aldkm etc. Each database has one table tblCustomer which is scripted as follows: if exists (select * from dbo.sysobjects where id =...
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.