Make table query and then using export specs to export the table to text file. (1 Viewer)

spet

Registered User.
Local time
Today, 11:50
Joined
Oct 5, 2018
Messages
38
Hello, I have a make table query that I then created a specification to export it to a text file. Some of the fields contain decimal places, but the business I am creating the text file for would like to elimanate all decimals and right align the numeric values. Thank you in advance!

Example:
My table data consists of:

Field1 Field2
14.25 .25

My text file specifications show

Field1 (Position1-5) (Length 5) (Type S9v999)
Field 2 (Position 6 -11) (Length 6) (Type S99v9999)

This is what I would like my text file to look like after output, but I can't figure out how to right align the fields or remove decimals?

1425 25
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:50
Joined
Oct 29, 2018
Messages
21,447
Hi. The forum software probable stripped out extra spaces from your post, so it's hard to decipher what you were trying to convey. You could either use code tags or post a screenshot of what you want instead to help explain it better. Cheers!
 

spet

Registered User.
Local time
Today, 11:50
Joined
Oct 5, 2018
Messages
38
I will represent my blank spaces in the expected output of the text file with S, so I would like my output to be. Field 1 pulling from my table as 14.25 and Field 2 pulling from the table as .25. I hope this makes sense?
S1425SSSS25
 

spet

Registered User.
Local time
Today, 11:50
Joined
Oct 5, 2018
Messages
38
I will just multiply my fields by 10 in my make table query. Still not sure how to get a spaces in front of these during the output to text file.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:50
Joined
Oct 29, 2018
Messages
21,447
I will just multiply my fields by 10 in my make table query. Still not sure how to get a spaces in front of these during the output to text file.
You have a few options like Format(), String(), or a literal string like "00000" that you can use to concatenate with your data. For example, with a fixed width of 6.
Code:
Format([FieldName]*10,"000000")
Hope that helps...
 

spet

Registered User.
Local time
Today, 11:50
Joined
Oct 5, 2018
Messages
38
Thank you so much theDBguy! Worked like a charm, exactly what I as looking for.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:50
Joined
Oct 29, 2018
Messages
21,447
Thank you so much theDBguy! Worked like a charm, exactly what I as looking for.
Hi. You're welcome. Glad we could assist. Good luck with your project.
 

Users who are viewing this thread

Top Bottom