Solved

Data Type

Posted on 2004-04-11
8
130 Views
Last Modified: 2013-12-24
Hi,
  I was wondering if I stored currency in my database as a Text Field, for instance the data can be 5.00 or $5.00 or simply 5, how do I add $10 to that field?

Nick
0
Comment
Question by:SolverSurfer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 10

Accepted Solution

by:
Mause earned 64 total points
ID: 10801452
Hi,

Difficult if its only a number it would be easy by just do 5 + 10 but if you also store the $ you must first remove it before you can add something to it. It would sugest not to store the currency value in the same field

Mause
0
 
LVL 35

Assisted Solution

by:mrichmon
mrichmon earned 62 total points
ID: 10802066
You may be able to store it as text and then do a conversion on the data before you do the addition and then convert back to save it - this could all be done int he one DB call.

what kind of database do you have? - I am guessing access in which case there are not as many DB side functions supported

It is probably best to try to store any numeric values that you will need to be manipulating as a numeric type (currency, float, double, etc)
0
 

Author Comment

by:SolverSurfer
ID: 10802108
It is Microsoft Access
0
 
LVL 17

Assisted Solution

by:anandkp
anandkp earned 62 total points
ID: 10804228
Store it as a number "data type"

& while displaying use "dollarformat()" to get the $

Once u have it as a number data type in Database - adding 10 to it wld be

Update table set currency_column = currency_column + 10
0
 
LVL 17

Assisted Solution

by:Tacobell777
Tacobell777 earned 62 total points
ID: 10808952
Store it as currency like it should be stored, it is currency so use the datatype currency.
To get the $ sign you could use lsCurrencyFormat() or dollarFormat()
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question