R
RichardO
Hi, I have this query that runs for minutes. I have SQL Server experience but
somehow in Access I get confused. Does anyone know how to improve the
performance? Here is the query:
"SELECT Codes.Code as CodeId, '',StringHeader.Reviewed as EnglishString, ''
as TranslatedString,StringHeader.Length as MaxLength,0 as
Status,StringHeader.Description FROM Codes INNER JOIN StringHeader ON
Codes.Id = StringHeader.CodeId where Codes.Id not in (SELECT String.CodeId
FROM Languages INNER JOIN [String] ON Languages.Id = String.LanguageId WHERE
(((Languages.Extension)='FRE'))) and StringHeader.AreaId=5 UNION ALL SELECT
Codes.Code, StringHeader_Sent.Reviewed, StringHeader.Reviewed,
String.Translated,
StringHeader.Length,Switch([StringHeader_Sent.Reviewed]<>[StringHeader.Reviewed],1,True,2),StringHeader.Description
FROM (StringHeader INNER JOIN Codes ON StringHeader.CodeId = Codes.Id) INNER
JOIN (([String] INNER JOIN Languages ON String.LanguageId = Languages.Id)
INNER JOIN StringHeader_Sent ON (String.CodeId = StringHeader_Sent.CodeId)
AND (String.LanguageId = StringHeader_Sent.LanguageId)) ON Codes.Id =
String.CodeId WHERE (((Languages.Extension) = 'FRE') and
(NoTranslationRequired =0)) ORDER BY 6,
1;"
somehow in Access I get confused. Does anyone know how to improve the
performance? Here is the query:
"SELECT Codes.Code as CodeId, '',StringHeader.Reviewed as EnglishString, ''
as TranslatedString,StringHeader.Length as MaxLength,0 as
Status,StringHeader.Description FROM Codes INNER JOIN StringHeader ON
Codes.Id = StringHeader.CodeId where Codes.Id not in (SELECT String.CodeId
FROM Languages INNER JOIN [String] ON Languages.Id = String.LanguageId WHERE
(((Languages.Extension)='FRE'))) and StringHeader.AreaId=5 UNION ALL SELECT
Codes.Code, StringHeader_Sent.Reviewed, StringHeader.Reviewed,
String.Translated,
StringHeader.Length,Switch([StringHeader_Sent.Reviewed]<>[StringHeader.Reviewed],1,True,2),StringHeader.Description
FROM (StringHeader INNER JOIN Codes ON StringHeader.CodeId = Codes.Id) INNER
JOIN (([String] INNER JOIN Languages ON String.LanguageId = Languages.Id)
INNER JOIN StringHeader_Sent ON (String.CodeId = StringHeader_Sent.CodeId)
AND (String.LanguageId = StringHeader_Sent.LanguageId)) ON Codes.Id =
String.CodeId WHERE (((Languages.Extension) = 'FRE') and
(NoTranslationRequired =0)) ORDER BY 6,
1;"