473,434 Members | 1,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

export numeric field right alligned

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 a left aligned table...
Can anyone help me?
Thanks

Aug 30 '07 #1
4 2838
<ja*********@gmail.comschreef in bericht news:11**********************@g4g2000hsf.googlegro ups.com...
>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 a left aligned table...
Can anyone help me?
Thanks
Don't fill the leading blanks with zero's but with spaces...

Arno R
Aug 30 '07 #2
>
Don't fill the leading blanks with zero's but with spaces...

Arno R
I'm not sure how I can do that.
If the value of the record is eg. 1.23, I need to fill 6 leading
blanks with spaces. If the value is 1234.56, I need to fill 3 leading
blanks with zeros.
Can I do this using the format function?
Thanks

Aug 30 '07 #3
ja*********@scarlet.be wrote:
>>Don't fill the leading blanks with zero's but with spaces...

Arno R


I'm not sure how I can do that.
If the value of the record is eg. 1.23, I need to fill 6 leading
blanks with spaces. If the value is 1234.56, I need to fill 3 leading
blanks with zeros.
Can I do this using the format function?
Thanks
a = 123.45
? Right(string(10," ") & a,10)
123.45
or
? Right(string(10,space(1)) & a,10)
123.45
Aug 30 '07 #4
Salad wrote:
ja*********@scarlet.be wrote:
>>Don't fill the leading blanks with zero's but with spaces...

Arno R

I'm not sure how I can do that.
If the value of the record is eg. 1.23, I need to fill 6 leading
blanks with spaces. If the value is 1234.56, I need to fill 3 leading
blanks with zeros.
Can I do this using the format function?
Thanks

a = 123.45
? Right(string(10," ") & a,10)
123.45
or
? Right(string(10,space(1)) & a,10)
123.45
Hmmmm...I decided to check for a number like 123.50.
a = 123.50
? Right(string(10,space(1)) & a,10)
123.5
? Right(string(10,space(1)) & format(a,"0.00"),10)
123.50
You might want to format to keep the ending 0's.
Aug 30 '07 #5

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

Similar topics

1
by: Ted Theodoropoulos | last post by:
i posted an earlier thread about exporting data from a subform in an ..ADP to an .MDB file. i had only one gracious response but it wouldn't work in the given situation. so i thought i would...
6
by: M.A. Oude Kotte | last post by:
Hi All, I hope this is the correct mailing list for this question. But neither postgresql.org nor google could help me out on this subject. I did find one disturbing topic on the mailing list...
8
by: Taffman | last post by:
I've searched this goup for an answer to this, there are many discussions that come close but non that I can find that actually addresses this particular problem. I'm exporting queries to Excel....
1
by: ANDRESUK | last post by:
Everyone, I'm trying to export a table containing numeric fields with formats such as "00000000" which would return the value with some leading zeros. It works fine in the table as it is...
0
by: sstell | last post by:
I’m doing a Data Transformation Service extract of data under MS-SQL 7.0. I have two fields that are numeric. I need to extract them to a text, fixed length file. When I extract them – I can get...
5
by: Takeadoe | last post by:
I've got a favor to ask - Consider the following numeric field: 511 6805 3205 403 I need to make 2 new numeric fields from this variable, call it CS
0
by: vbvr | last post by:
I need to export a numeric field (TAX ID) from vb.net to Excel. The value gets converted to Numeric in Excel and leading zeroes are lost. I tried to use code posted on this site. But the style...
9
by: NEWSGROUPS | last post by:
I have data in a table in an Access 2000 database that needs to be exported to a formatted text file. For instance, the first field is an account number that is formatted in the table as text and...
2
by: mkbrady | last post by:
I have a query that includes calculated fields that generate numeric results. I have wrapped conversion functions CLng() and CDdl() around the calculated fields to ensure the data types are...
1
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...
0
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...
0
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
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...
0
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
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...
0
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,...
0
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
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...

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.