Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel 2007 right click edit query | Excel Worksheet Functions | |||
Edit query in excel | Excel Programming | |||
Edit query in excel 2000 | Excel Discussion (Misc queries) | |||
edit dqy file (Excel ODBC Query) | Excel Programming | |||
Edit Query from Excel will not open query in MSQuery | Excel Programming |