K
koturtle
I have a union query in Access that takes a long time to run. I would
like to put this query into SQL and see if i get any performance
increases. My union query in access looks like this:
select Janvalue as TotalValue, cvdate("1/31/" & [Year]) as MonthEnd,
costelementtypevalue,valuetype, projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
where Iif(Left([Forms]![General_Form]![Project_ID],2)="V/",Left
([Forms]![General_Form]![Project_ID],1) & Right([Forms]![General_Form]!
[Project_ID],4),[Forms]![General_Form]![Project_ID])=projprojectid
UNION ALL select Febvalue, cvdate("2/28/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Marvalue, cvdate("3/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Aprvalue, cvdate("4/30/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Mayvalue, cvdate("5/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Junvalue, cvdate("6/30/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Julvalue, cvdate("7/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Augvalue, cvdate("8/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Sepvalue, cvdate("9/30/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Octvalue, cvdate("10/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Novvalue, cvdate("11/30/" & [Year]),
costelementtypevalue,valuetype, projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Decvalue, cvdate("12/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts];
Apparenlty the cvdate doesn't work and it doesn't like "=" or "!"
either.
[dbo_TotalProjectCosts] is a query in SQL already.
Any help would be great!
TIA,
KO
like to put this query into SQL and see if i get any performance
increases. My union query in access looks like this:
select Janvalue as TotalValue, cvdate("1/31/" & [Year]) as MonthEnd,
costelementtypevalue,valuetype, projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
where Iif(Left([Forms]![General_Form]![Project_ID],2)="V/",Left
([Forms]![General_Form]![Project_ID],1) & Right([Forms]![General_Form]!
[Project_ID],4),[Forms]![General_Form]![Project_ID])=projprojectid
UNION ALL select Febvalue, cvdate("2/28/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Marvalue, cvdate("3/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Aprvalue, cvdate("4/30/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Mayvalue, cvdate("5/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Junvalue, cvdate("6/30/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Julvalue, cvdate("7/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Augvalue, cvdate("8/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Sepvalue, cvdate("9/30/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Octvalue, cvdate("10/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Novvalue, cvdate("11/30/" & [Year]),
costelementtypevalue,valuetype, projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts]
UNION ALL select Decvalue, cvdate("12/31/" & [Year]),
costelementtypevalue, valuetype,projprojectid, resourceCode,
resourcedescription, WBSID, WBSDescription from
[dbo_TotalProjectCosts];
Apparenlty the cvdate doesn't work and it doesn't like "=" or "!"
either.
[dbo_TotalProjectCosts] is a query in SQL already.
Any help would be great!
TIA,
KO