Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format Exported Text

Status
Not open for further replies.

laman

Technical User
Jan 24, 2002
44
US
Need some help with this one. I have the following query:

SELECT Format([section] & [Row_no] & "-" & [Tube_no]) AS MyNum
FROM master
WHERE ((([master].[CL])="C9"));

Which I export to a text file with the following Tranfertext command:

DoCmd.TransferText acExportDelim, "ndd", "query1", "a:\ndd.sdf"

The end result looks like this

O3-2
O4-1
I10-5
I6-2 and so on.

I would like to eliminate the two spaces to the left (Justified to the left)

O3-2
O4-1
I10-5
I6-2

and prompt the user to input a number which would be inserted on the first line before the text is exported.
If the user input was 10, should look like this:

10
O3-2
O4-1
I10-5
I6-2

If it isn't too confusing, please help.
Thanks!
Laman

 
This will work for your justification...

SELECT LTrim(Format([section] & [Row_no] & "-" & [Tube_no])) AS MyNum
FROM master
WHERE ((([master].[CL])="C9"));

The insertion can't be done with SQL though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top