Go to Google Groups Home    microsoft.public.excel.querydao
Re: External data source / MS Query Command Text

Dick Kusleika <dkusle...@gmail.com>

On Mon, 5 Feb 2007 16:04:01 -0800, Allen_N

<All...@discussions.microsoft.com> wrote:
>When I Refresh the data source (which is a view in an Access ADP) the columns
>are returned to my spreadsheet in the wrong order.

>By default, the Command Text window contains simply:

>   "Availability"."dbo"."vwShortagesByItem"

>I tried changing Command Type to 'SQL' and entering:

>   SELECT  ItemNo, Description, Commodity_Group, Nat_Rank, Avg_Cost,
>   Net_Ordered, Net_Supplied, Net_Shortage, Occurences, Branches,
>   Customers  FROM  Availability.dbo.vwShortagesByItem

>but the columns are returned in the order:

>   ItemNo, Commodity_Group, Nat_Rank, Avg_Cost, Net_Ordered, Net_Supplied,
>   Net_Shortage, Occurences, Branches, Customers, Description

Allen:  In Range Properties, uncheck the Preserve Columns check box.
See here

http://www.dailydoseofexcel.com/archives/2004/06/02/add-new-column-to...

--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com