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

Home Posts Topics Members FAQ

Formatting a Fixed With Query Column

18 New Member
I have a field in SQL that contains a Currency amount, which will be used for an export. It needs to be 13 characters long, preceded by 0 then the dollar amount, without the decimal point.

The field name is DOCAMT. To get the full amount, I'm sure that I need to multiply the currency by 100, but how do I get the dynamic part of the field to be 0's.

Since this will be an export, it would need to be a query instead of vba.

Example:

DOCTAMT= 205.47
Multiplied by 100 gives me 20547, which is correct.
But how do I get 8 0's in front of it, ie. 0000000020547.

The next DOCAMT might be 1234.56 and would need to be 0000000123456

Any ideas?

Thanks

Jeff
Aug 10 '10 #1
1 1151
jimatqsi
1,276 Recognized Expert Top Contributor
You could do this
Format (Cint(DOCAMT*10 0),"00000000000 00")

Jim
Aug 11 '10 #2

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

Similar topics

4
3240
by: Michael Hill | last post by:
I am having a problem formatting the third column. It should be 70px wide, but it is extending well beyond 70. The 2nd and 3rd column should be the same width. The content of the 3rd column wraps like it is suppose to, but the width does not get fixed at 70px. <table border="1"> <tr> <td>
3
2029
by: Billy Jacobs | last post by:
I have created a DataGridColumnDatePicker Component so that I can put a datetimepicker control in my datagrid. It almost works. When I put my mouse in the cell it changes to a datetimepicker control. I can then select a date which displays in the cell. When I leave the cell however I get the following error:
3
7066
by: Spondishy | last post by:
OK... After a previous post, I've decided that the site layout will be two columns The layout will be: 1) Page 100% wide 2) Right column will be fixed 150px, left column will use the rest of the space
7
6266
by: Jean | last post by:
Hello I have a query that takes information from the column of a table, very simply: SELECT NAME FROM tblPeople; I want to add another column to my query, but I just want the rows to contain one value, say 0, and I want to specify that value in the SQL
40
4456
by: Mark | last post by:
Hello i like to make the following lay out: - 3 columns - center column = fixed width - left and right columns are not fixed and must take all the available space there is left. - left column has a background picture - right column has another background picture
9
3100
by: TristaSD | last post by:
Hi, How do I accomplish the following: In a two-column layout, the right column is 200px wide, and the left column is fluid? Thanks!
2
3151
by: sunilkes | last post by:
Hi, I have a crosstab query made by a linked table, the row headers are displayed correctly, but the column headers are showing the SNo (Autonumber) value instead of the NAME field. Please help Cheers
3
8813
by: David | last post by:
I am using .Net 2.0 and VS2005 with SQL server db. The datetime columns on SQL have the date and time in them. How can I display just the short date format (e.g. a datetime of 10/19/2006 11:23:57 AM to show as just 10/19/2006)? I do not want to use the SQL CONVERT on the query because it affects the sorting of the column in a GridView. If I leave the date and time together, I get the correct sort. Below is a sample of my textbox on...
0
8685
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
8633
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
8348
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,...
0
8493
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7176
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...
1
6112
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
4084
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...
1
2613
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
1797
muto222
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.