Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL: custom names of columns when using IIF (excel quering access database)
Hi all,
I am creating in Excel (via data/import new external data/new database query) a query from MS Access database using statement IIF, but excel ignore my column names (... AS 'custom name'...) and use artificial ones (e.g. expr1002,expr1003 etc) My code looks like: SELECT table1.persID AS 'ID personal', table1.surname+' '+table1.name AS 'Full name' , IIF ((select top 1 tbl2.order from tbl2 tbl2 where table1.year_ID = tbl2.year_ID and tbl2.PID = table1.PID and tbl2.order is not null )is null , null , (select top 1 tbl2.order from tbl2 tbl2 where table1.year_ID = tbl2.year_ID and tbl2.PID = table1.PID and tbl2.order is not null) ) as 'Order' FROM table1 table1 I want to have table with columns 'ID personal', 'Full name' and 'Order', but I recieve fine data with funny column names. What is wrong? Thank you for any hint. riso |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Update Excel Database via Access Main Database with a script | New Users to Excel | |||
Excel(2007) crashes on quering for DrawingObjects selection | Excel Programming | |||
Excel Spreadsheet from Access. List of names changes as names are | Excel Discussion (Misc queries) | |||
Return MS-SQL database names to excel? | Excel Programming |