I'm using th efololowing SQL:
I run this query from Aqua Data Studio and ...well the query is still runnuing.......
I tried creating a view with this code:
and I get an error...
The reason for trying to build a view is to cut down on the query time......(the query is still running from Aqua Data Studio over 10 minutes)
Any sugestions on this ?
Code:
SELECT OESHDT.CUSTOMER, OESHDT.ITEM, OESHDT.YR, OESHDT.PERIOD, OESHDT.TRANDATE, OESHDT.DAYENDSEQ, OESHDT.TRANSSEQ, OESHDT.LINENO, OESHDT.TRANNUM, OESHDT.ORDDATE, OESHDT.SHIPDATE, OESHDT.SALESPER, OESHDT.QTYSOLD, OESHDT.SCSTSALES, OESHDT.FAMTSALES, OESHDT.SAMTSALES, OESHDT.FRETSALES, OESHDT.SRETSALES, OESHDT.PONUMBER, OESHDT.FAMTTRAN, OESHDT.SAMTTRAN, OESHDT.FAMTDISC, OESHDT.SAMTDISC, ARCUS.CUSTTYPE, OEINVH.TERMS, ARRTA.TEXTDESC, ICITEM.ALTSET, 'ICITEM.DESC', ICITEM.CATEGORY, ICITEM.CNTLACCT, ICITEM.STOCKITEM
FROM ICITEM INNER JOIN (((ARCUS INNER JOIN OESHDT ON ARCUS.IDCUST = OESHDT.CUSTOMER) INNER JOIN OEINVH ON OESHDT.ORDNUMBER = OEINVH.ORDNUMBER) INNER JOIN ARRTA ON ARCUS.CODETERM = ARRTA.CODETERM) ON ICITEM.ITEMNO = OESHDT.ITEM
ORDER BY OESHDT.CUSTOMER, OESHDT.SALESPER, OESHDT.PONUMBER
I tried creating a view with this code:
Code:
Sub Create_View()
Dim conn As ADODB.Connection
Set conn = CurrentProject.Connection
On Error GoTo ErrorHandler
conn.Execute "CREATE VIEW vw_com AS "& above sql
ExitHere:
If Not conn Is Nothing Then
If conn.State = adStateOpen Then conn.Close
End If
Set conn = Nothing
Exit Sub
ErrorHandler:
If Err.Number = -2147217900 Then
conn.Execute "DROP VIEW vw_com"
Resume
Else
Debug.Print Err.Number & ":" & Err.Description
Resume ExitHere
End If
End Sub
The reason for trying to build a view is to cut down on the query time......(the query is still running from Aqua Data Studio over 10 minutes)
Any sugestions on this ?