I'm trying to figure out how to get an update query to work. I need to get dollar amounts into standard lengths and formats for export into our main system. The dollar amounts need to be 17 digits with zero's to the left and no decimal. For example:
$7.26 becomes 00000000000000726
$24,974.57 becomes 00000000002497457
and so on.
Can anyone help with what formula to put into the Update To: section of the query???
@ckpoll2
With a Currency Field, you may be better off displaying your results in a Calculated Field. Assuming your Table name is tblProject, and your Currency Field is [Amount], to Format the results in a Calculated Field named [Converted_Amount] to 17 digits with leading zeros, no Decimals, and the 2 rightmost digits representing cents: - SELECT tblProject.Amount, Format(100*[Amount],"00000000000000000") AS Converted_Amount
-
FROM tblProject
-
WHERE (((tblProject.Amount) Is Not Null));
Sample OUTPUT: -
Amount Converted_Amount
-
$7.26 00000000000000726
-
$24,974.57 00000000002497457
-
$85.00 00000000000008500
-
$1.03 00000000000000103
-
4 3672 @ckpoll2
With a Currency Field, you may be better off displaying your results in a Calculated Field. Assuming your Table name is tblProject, and your Currency Field is [Amount], to Format the results in a Calculated Field named [Converted_Amount] to 17 digits with leading zeros, no Decimals, and the 2 rightmost digits representing cents: - SELECT tblProject.Amount, Format(100*[Amount],"00000000000000000") AS Converted_Amount
-
FROM tblProject
-
WHERE (((tblProject.Amount) Is Not Null));
Sample OUTPUT: -
Amount Converted_Amount
-
$7.26 00000000000000726
-
$24,974.57 00000000002497457
-
$85.00 00000000000008500
-
$1.03 00000000000000103
-
You are amazing!! Thanks so much for your help!!
NeoPa 32,556
Expert Mod 16PB
Very much along the lines ADezii has already suggested : - SELECT [Amount],
-
Format(100*[Amount],String(17,'0')) AS Converted_Amount
-
FROM tblProject
-
WHERE ([Amount] Is Not Null)
You guys are great. Thanks again!!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Philip Boonzaaier |
last post by:
I want to be able to generate SQL statements that will go through a list of
data, effectively row by row, enquire on the database if this exists in the
selected table- If it exists, then the colums...
|
by: robert |
last post by:
been ruminating on the question (mostly in a 390/v7 context) of
whether, and if so when, a row update becomes an insert/delete.
i assume that there is a threshold on the number of columns of
the...
|
by: Ken Bush |
last post by:
How can I write an update query that removes part of a field? Like if I
have a field with values such as 8/3/68 (a birthday obviously) and I need
to put values in a new column but I need...
|
by: nadmasl |
last post by:
I have an MS Access form, where a user enters the date by selecting it
from three combo boxes for day, month and year. I convert it to
11-Jan-2004 format and attempt to write to the table with an...
|
by: Dalan |
last post by:
I'm not certain if this is doable in the manner explained below, but
I'm certain that there have been Access developers who have done
something similar. So whatever insight and assistance that can...
|
by: Maxi |
last post by:
There is a lotto system which picks 21 numbers every day out of 80
numbers.
I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21)
Here is the structure and sample data:
...
|
by: Bob Bedford |
last post by:
hello
I'm looking for some functions or objects allowing to
select-insert-update-delete from any table in a mysql database without the
need to create a new query every time. Example:
...
|
by: jmarcrum |
last post by:
Hey everyone,
I have a question that's been troubling me for a bit. I work for Alabama Power. I have 1 table (tblOutages). Every morning I import a list of Power Outages for the state of...
|
by: Michel Esber |
last post by:
Hi all,
DB2 V8 LUW FP 15
There is a table T (ID varchar (24), ABC timestamp). ID is PK.
Our application needs to frequently update T with a new value for ABC.
update T set ABC=? where ID...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |