473,624 Members | 2,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Field is Decimal and I want to Zero Fill

31 New Member
I have a table that is named “field14" that is set to
Data Type: Currency
Format: Fixed
Decimal Places: 2

This field is populated correctly but I want to convert the currency to 14 digest with zero fill. Example: "2.20" would be "00000000000220 " I have tried an update query with format but it didn't work. Any suggestions?
Thanks,
Wayne L
Dec 17 '07 #1
5 4396
Rabbit
12,516 Recognized Expert Moderator MVP
You'll have to change your field to text. You can't store it as a number.
Dec 17 '07 #2
Wayne L
31 New Member
You'll have to change your field to text. You can't store it as a number.
Rabbit,
I have tried to change it to text but it converts back to a decimal. I am importing a .dbf file into the Access database. The field actually has 4 decimals to the right. example: 2.2050 this is converted to 2.20 when imported. I need to zero fill and read 220 as 00000000000220. I have created a temp table and append the master table to convert it to text but it changes back to the 4 decimal places??
Wayne
Dec 17 '07 #3
NeoPa
32,566 Recognized Expert Moderator MVP
Create a separate (text) field then use an UPDATE query to populate this new field. The Format() function can be used to lay the data out correctly.
Your example data was not very clear though. You say 20 digits but how do you want it to handle the decimals? Like a multiplication by 10,000? Simply strip the decimal point wherever it appears in the source?
Dec 17 '07 #4
Wayne L
31 New Member
Thanks for the input. I am taking the approach of multiplying to remove the decimal and then zero fill with an update query.
Thanks again for you input.
Wayne
Dec 18 '07 #5
NeoPa
32,566 Recognized Expert Moderator MVP
No problems Wayne.
I take it from your post that you're sorted now yes?
Dec 18 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

21
4517
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/modifying the code. Thank you. .. Facundo
6
10536
by: Peter Blatt | last post by:
Does 5 represent the total numer of digits (including the fractional portion) or only the number of places BEFORE the decimal point? Moreover does the number include the decimal point? Are there differences between the databases servers ? Peter
1
3732
by: stuart | last post by:
I am trying to format a number in an unbound text field using the following format statement in the field's Exit event: txt11UnitWeight = Format(txt11UnitWeight, "00000.00") I want the number to the left of the decimal to be 5 digits long, left zero filled and 2 digits to the right of decimal. Entering a number such as 12345 will get me the required 12345.00. If I have a number such as 1234525, I want the program to format the
10
11137
by: Peter Piper | last post by:
A Quick question if someone could help, im sure this has been asked before, but googling is getting me now where slowly. Is it possible to get an unsigned 32 bit integer field in Access. Im storing IP address in their integer form (ie. 32 bits) and Long Integer because it is signed can not represent the full range needed (0..4294967295), neither can Double. Any suggestions please?
8
1555
by: Tony Williams | last post by:
I have a form where the user inputs a series of figures into a number of controls. After they've input the total (they don't want the program to create the total) there is a check to make sure the total of the controls equals the totals they've input. Here is the code in the Before Update property: Private Sub txtAdvTot_BeforeUpdate(Cancel As Integer) If ( + + + + + + ) <> Then If MsgBox(" Column 1 does not add up" & vbCrLf & "It...
29
721
by: Gaijinco | last post by:
Sooner or later everytime I found recreational programming challenges I stumble with how I test if a number is has decimal places differnt than 0? For example if I want to know if a number is a square number (i.e. a number which square root is a positive number as 4, 9, 16 have) I do something like: int square = sqrt(number);
5
2856
by: Dan C Douglas | last post by:
I have just installed VS.NET 2003 on my computer. I have a project that I have been developing on VS.NET 2002. I haven't upgraded this project to VS.NET 2003 yet and I am still developing it in VS.NET 2002. When I am putting values from my SQLDataReader into labels and text boxes I am getting results such as 400.0000, or 25.90. For example... ? dr("CostsPerBin") returns
9
9680
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a master-child link to the first subform. subform2 - Master Field: subTrainingModule.Form!TrainingModuleTopicSK Child Field: TrainingModuleTopicSK
4
2850
by: janssensglb | last post by:
I want to export from Access 2000 a numeric field (double) to a text file. The export file should be fixed length (no delimiters), the field should have 9 digits in total, including 2 decimals. I want the field to be right aligned so that the decimal separator is always in the same column in the text file. I don't want to fill any leading blanks with zeros. I tried to do this using the format function in a query but I always end up with...
0
8170
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
8675
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
8619
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...
0
7158
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
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
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.