473,480 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Insert decimal?

I'm thinking this ought to be easy (just not for me - lol).

Field Price has values like this:

12500
9999
12999
105099

What's happened is that the person who originally populated it neglected to
put in the decimal point. So I need to start from the right, move 2 digits
to the left and drop a decimal in to get:

125.00
99.99
129.99
1050.99

Mid function? Not sure...

Thanks.
Mar 24 '06 #1
1 8147
On Fri, 24 Mar 2006 13:16:25 -0600, Andy Jenkins wrote:
I'm thinking this ought to be easy (just not for me - lol).

Field Price has values like this:

12500
9999
12999
105099

What's happened is that the person who originally populated it neglected to
put in the decimal point. So I need to start from the right, move 2 digits
to the left and drop a decimal in to get:

125.00
99.99
129.99
1050.99

Mid function? Not sure...

Thanks.


It depends.
What is the field's Datatype.
If it is Number Integer or Long integer, you cannot have a decimal
value.
If the datatype is Number (Double) or Currency,
=[FieldName]/100

125 becomes 1.25
12500 becomes 125

The above are still numbers.

If you just wish to display the value with 2 decimals, use:
=Format([FieldName]/100,"#.00")
but this is now a string value and cannot be used in future
calculations.
125 becomes 1.25
12500 becomes 125.00

You can use the above expressions in an Update query to permanently
change the field values.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Mar 24 '06 #2

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

Similar topics

9
3447
by: Martin | last post by:
Hello, I'm new with triggers and I can not find any good example on how to do the following: I have two tables WO and PM with the following fields: WO.WONUM, VARCHAR(10) WO.PMNUM,...
2
1966
by: SAN CAZIANO | last post by:
how can i insert only a real number (an integer with only one decimal separator) in a edit field perhaps in onchange event I have to test if the decimal separator in the text is >0 I simply...
4
11936
by: Mike | last post by:
I am getting a type mismatch error when I do a bulk insert. ---Begin Error Msg--- Server: Msg 4864, Level 16, State 1, Line 1 Bulk insert data conversion error (type mismatch) for row 1, column...
0
2241
by: John D. | last post by:
I am having problems inserting Decimal values into a DB2 database via a .NET/C# application which is using an OdbcDataAdapter. Other field types such as VarChar, Int, Date, etc work ok, and I can...
1
7639
by: ven | last post by:
hello i`m makin a asp.net service with database connection where i have an insert with decimal value, when i run my function i get this error : There are fewer columns in the INSERT statement...
7
2285
by: fintudet | last post by:
Hello. During some experimentation with DB2 decimal numbers representations, I have discovered very unexpected behaviour of the global temporary table. Consider this example. Such I had...
2
6198
by: Dot Net Daddy | last post by:
Hello, I cannot get the following Insert Command work. I get the error: Error converting data type varchar to numeric. Description: An unhandled exception occurred during the execution of...
8
9381
by: Santy | last post by:
Hello All, I am new to DB2, Currently i am using DB2 version 8.02 personal edition on Windows XP Professional. And Facing problem with rowlock in insert query. I have created a sample database...
0
4025
by: troydixon | last post by:
Hello, I am new at this, and have been trying to insert data into a table by using the footer of a gridview (which I dont like) or by using a detials view on the same page that is doing the...
5
3545
by: maestroQC | last post by:
Hi, Its one of those days. I cannot solve this. Any help would be greatly appreciated! When I execute this: class Db(object): def insertAccount(self, date, accountNumber, description,...
0
7049
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,...
0
7052
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
7092
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...
1
6744
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...
1
4790
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...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3000
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...
0
1304
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 ...
1
565
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.