By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,679 Members | 2,749 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,679 IT Pros & Developers. It's quick & easy.

export numeric field right alligned

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
<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

P: n/a
>
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.