We help IT Professionals succeed at work.

DoCmd.TransferText select column with alias name

kumarjcet
kumarjcet asked
on
hi..
how to select only some columns while exporting to csv

DoCmd.TransferText acExportDelim, , "SELECT [Project Id],[PO NO]  FROM [dbo].Tableone]", strFileName, True, ""

Comment
Watch Question

SQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015
Commented:
(Assuming Access)

Project ID and PO NO are both columns.
Since there are spaces in the column names you need to surround them with square brackets [ ].
You can type any number of column names you want, separated by commas.

Also, there's a typo in your statement, an extra square bracket to the right of Tableone.

Jim

Author

Commented:
I've requested that this question be deleted for the following reason:

sorry
Jim HornSQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015

Commented:
Asker needs to explain what his current status is, and if the expert comment helped.