Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Convert SQL to VB

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-02-17 : 06:49:35
crem writes "Hello...Can someone show me how to convert the following SQL into VB?


TRANSFORM (Sum([tbl_Dfct_Dnsty].[countofSCR_ID])*1000)/[RPT_NUM_REQ_ATR_ELEVTN] AS Defect_Density
SELECT [tbl_Dfct_Dnsty].[ACT_ELEVTN_DT] AS [DATE], [tbl_Dfct_Dnsty].[RPT_NUM_REQ_ATR_ELEVTN] AS [# of Req], [tbl_Dfct_Dnsty].[PVCS_PROJ_NM], Sum([tbl_Dfct_Dnsty].[CountOfSCR_ID]) AS DEFECT, IIf([tbl_Dfct_Dnsty].[SUBDIVISION_NM]="Corporate Technology Services ",(Sum([CountOfSCR_ID]*1000))/([RPT_NUM_REQ_ATR_ELEVTN]),"") AS Corporate, IIf([tbl_Dfct_Dnsty].[SUBDIVISION_NM]="Institutional Systems",(Sum([CountOfSCR_ID]*1000))/([RPT_NUM_REQ_ATR_ELEVTN]),"") AS Institutional, IIf([tbl_Dfct_Dnsty].[SUBDIVISION_NM]="Retail Systems",(Sum([CountOfSCR_ID]*1000))/([RPT_NUM_REQ_ATR_ELEVTN]),"") AS Retail
FROM tbl_Dfct_Dnsty
WHERE (((1)=1) And (([tbl_Dfct_Dnsty].[CATEGORY_NM])='Defect'))
GROUP BY [tbl_Dfct_Dnsty].[ACT_ELEVTN_DT], [tbl_Dfct_Dnsty].[RPT_NUM_REQ_ATR_ELEVTN], [tbl_Dfct_Dnsty].[PVCS_PROJ_NM]
ORDER BY [tbl_Dfct_Dnsty].[PVCS_PROJ_NM]
PIVOT [tbl_Dfct_Dnsty].[SUBDIVISION_NM];"
   

- Advertisement -