First(OP.RESOURCE_ID) as FirstID
I'm getting the error
ORA-00904: Invalid Column Name
I've never written a query to do this but I know I have to be close. I can get the query to work when written entirely using MS-ACCESS 2003 to assist me with syntex. Can someone tell me what I'm doing wrong??
Dim rsPrint As New ADODB.Recordset Dim strSQL As String strSQL = "SELECT WO.DRAWING_ID, WO.DRAWING_REV_NO, WO.PART_ID, WO.BASE_ID, WO.DESIRED_WANT_DATE, WO.STATUS, WO.DESIRED_QTY, First(OP.RESOURCE_ID) as FirstID " _ & "FROM Sysadm.Work_Order WO, SYSADM.OPERATION OP where WO.BASE_ID = OP.WORKORDER_BASE_ID " _ & "GROUP BY WO.DRAWING_ID, WO.DRAWING_REV_NO, WO.PART_ID, WO.BASE_ID, WO.DESIRED_WANT_DATE, WO.STATUS, WO.DESIRED_QTY, WO.TYPE, WO.PRINTED_DATE " _ & "HAVING (((WO.STATUS='R') Or (WO.STATUS='F')) AND (TYPE='W') AND (WO.PRINTED_DATE Is Null)) " _ & "ORDER BY BASE_ID" With rsPrint .ActiveConnection = MatCon .LockType = ADODB.LockTypeEnum.adLockReadOnly .CursorType = ADODB.CursorTypeEnum.adOpenStatic .Open(strSQL) End With