Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Edit query in Excel

Hi
I am trying to pull information from SQL server by editing a existing
query in excel. I could able to pull data but the format is changing
from the existing format.

My format will be like this

coulmN-A coulmN-B coulmN-c coulmN-D

I need only CoulmnA, ColumnB and ColumnD from SQL server. ColumnC will
be manually entered. After editing query the data is filling to first 3
coulmns not 1st two and fourth columns.

Could you please advice how to tackle this problem.

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,118
Default Edit query in Excel

Try something like this:

Edit the query in MSQuery
Click the [SQL] button

Manually enter a new field where you want it to appear, using this syntax
'' AS 'InputCol'
(Replace InputCol with whatever field name you want to appear in the
worksheet.

Example:

Starting with this SQL:
SELECT
rngDatesString.MyDates
, rngDatesString.MyStrings
FROM
`C:\ExcelQueries\Lists`.rngDatesString rngDatesString

I inserted the sample field as follows:
SELECT
rngDatesString.MyDates
, '' AS 'InputCol'
, rngDatesString.MyStrings
FROM
`C:\ExcelQueries\Lists`.rngDatesString rngDatesString

Note: when manually entered fields are imported to Excel, they display with
the single quotes. In my version of Excel (2002), I don't think there's a
way to avoid that.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Vandy" wrote:

Hi
I am trying to pull information from SQL server by editing a existing
query in excel. I could able to pull data but the format is changing
from the existing format.

My format will be like this

coulmN-A coulmN-B coulmN-c coulmN-D

I need only CoulmnA, ColumnB and ColumnD from SQL server. ColumnC will
be manually entered. After editing query the data is filling to first 3
coulmns not 1st two and fourth columns.

Could you please advice how to tackle this problem.

Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Edit query in Excel

Hi Ron

Thanks for the reply. I have already title under column D
But the data is sitting under column C after the query.
The column D is shifting right side.

Do you have any suggestion on this?

Thanks
Chinna



*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,118
Default Edit query in Excel

I may have misunderstood your request.
If you have manually entered values in Col_C, the data import will overwrite
them with blanks or move Col_C over to the right, depending on the table
options you select. There's no way to have the data import fill columns A,
B, and D without impacting Col_C, if that's what you were hoping for.

There may be other possibilities, via MS Query...depending on the specifics
of your structure.

Can you describe how you use (or hope to use) the data?
***********
Regards,
Ron

XL2002, WinXP


"chinna sankar" wrote:

Hi Ron

Thanks for the reply. I have already title under column D
But the data is sitting under column C after the query.
The column D is shifting right side.

Do you have any suggestion on this?

Thanks
Chinna



*** Sent via Developersdex http://www.developersdex.com ***

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2007 right click edit query Koppite412 Excel Worksheet Functions 1 September 3rd 08 06:26 PM
Edit query in excel chinna sankar Excel Programming 0 November 7th 06 03:04 PM
Edit query in excel 2000 Joel Nieto Excel Discussion (Misc queries) 0 April 17th 06 09:31 PM
edit dqy file (Excel ODBC Query) RalphIBower Excel Programming 1 December 9th 05 10:48 PM
Edit Query from Excel will not open query in MSQuery Michelle Excel Programming 0 February 21st 05 03:59 PM


All times are GMT +1. The time now is 12:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"