G
Guest
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')
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')