LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
ln54
 
Posts: n/a
Default MS-Query code from EXCEL97 doesn't work in EXCEL2003 ??

I am using MS-Query to import data from SQLServer2000 to MS-EXCEL.
We recently upgraded to EXCEL2003 from EXCEL97 and now MS-Query don't
understand more "complicated" code
which worked without problems in EXCEL97.

The code below is an example of this problem. I understand that I can solve
this through building views in SQLServer but I would prefer not to because of
the number of views required.

What has happended to MS-Query in EXCEL2003 and is there an solution to this
available from Microsoft?
---------------------------------------------------------------------------------------

SELECT
(USER_DISBURSED_PLANNING2.Allocation_Account) as 'Alloc',
USER_DISBURSED_PLANNING2.Allocation_Account_Text,
USER_DISBURSED_PLANNING2.CountryCode2,
USER_DISBURSED_PLANNING2.CountrynameSv2,
Excel_Sektorer_MH.H_SEKTOR_KOD + ' ' + Excel_Sektorer_MH.Main_Sector
as 'Main_Sector',
Excel_Vomr_Öst.Vomr_Öst +' '+ Excel_Vomr_Öst.Verksamhetsområde
as 'Vomr_Öst',
USER_DISBURSED_PLANNING2.Contribution_ID + ' ' +
USER_DISBURSED_PLANNING2.Contribution_Title_Eng AS 'Contribution',
USER_DISBURSED_PLANNING2.Resp_Officer_Cont as 'Officer',
USER_DISBURSED_PLANNING2.Agr_Start,
USER_DISBURSED_PLANNING2.Agr_End,
USER_DISBURSED_PLANNING2.Status as 'S',
Sum(USER_DISBURSED_PLANNING2.Outcome_2004) AS 'Disb_2004' ,
Sum(USER_DISBURSED_PLANNING2.Outcome_Present_Year) as 'Disb_2005',
Sum(USER_DISBURSED_PLANNING2.DAA2004) as 'DAA_2004',
Sum(USER_DISBURSED_PLANNING2.DAA2005) as 'DAA_2005',
Sum(USER_DISBURSED_PLANNING2.DAA_TOTAL) as 'DAA_Total',
Sum(USER_DISBURSED_PLANNING2.FC2004) as 'FC_2004',
Sum(USER_DISBURSED_PLANNING2.FC2005) as 'FC_2005'
FROM
LISPC05.dbo.USER_DISBURSED_PLANNING2 USER_DISBURSED_PLANNING2 LEFT OUTER JOIN
LISPC05.dbo.Excel_Vomr_Öst Excel_Vomr_Öst
ON USER_DISBURSED_PLANNING2.Sector = Excel_Vomr_Öst.SectorCode
LEFT OUTER JOIN LISPC05.dbo.Excel_Sektorer_MH Excel_Sektorer_MH
ON USER_DISBURSED_PLANNING2.Sector = Excel_Sektorer_MH.SEKTOR_KOD
GROUP BY
USER_DISBURSED_PLANNING2.Allocation_Account,
USER_DISBURSED_PLANNING2.Allocation_Account_Text,
USER_DISBURSED_PLANNING2.CountryCode2,
USER_DISBURSED_PLANNING2.CountrynameSv2,
Excel_Sektorer_MH.H_SEKTOR_KOD,
Excel_Sektorer_MH.Main_Sector,
USER_DISBURSED_PLANNING2.Contribution_ID,
USER_DISBURSED_PLANNING2.Contribution_Title_Eng,
USER_DISBURSED_PLANNING2.Resp_Officer_Cont,
USER_DISBURSED_PLANNING2.Agr_Start,
USER_DISBURSED_PLANNING2.Agr_End,
USER_DISBURSED_PLANNING2.Status,
Excel_Vomr_Öst.Vomr_Öst,
Excel_Vomr_Öst.Verksamhetsområde
HAVING
(USER_DISBURSED_PLANNING2.Status IN ('P', 'A'))
AND (USER_DISBURSED_PLANNING2.Allocation_Account
IN ('15651', '15661', '15691', '15692', '15741', '2342' ,'156911',
'156912', '156913', '156914', '156919' )
AND USER_DISBURSED_PLANNING2.CountryCode2
IN
('RUS','BLR','UKR','EST','LVA','LTU','BAL','BGR',' ROM','ROU','POL',
'SVK','SVN','CZE','HUN','COE' ) )

OR (USER_DISBURSED_PLANNING2.Status LIKE 'C') AND
(USER_DISBURSED_PLANNING2.Allocation_Account
IN ('15651', '15661', '15691', '15692', '15741', '2342' ,'156911',
'156912', '156913', '156914', '156919' )
AND USER_DISBURSED_PLANNING2.CountryCode2
IN ('RUS','BLR','UKR','EST','LVA','LTU','BAL','BGR',' ROM','ROU','POL',
'SVK','SVN','CZE','HUN','COE' )
)
AND (USER_DISBURSED_PLANNING2.Agr_End '200400')





 
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
Query of External Data Excel GuRu Excel Discussion (Misc queries) 2 January 3rd 05 07:43 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM
Problem Code: Retrieving Stored Access 03 Query Bettergains Excel Discussion (Misc queries) 2 December 7th 04 04:11 PM
Problem with Query John Links and Linking in Excel 4 December 7th 04 02:49 PM
formula from Excel97 doesn't work in Excel2003,any ideas why? nic Excel Worksheet Functions 6 November 8th 04 04:40 PM


All times are GMT +1. The time now is 02:17 PM.

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"