N
NKA
I currently have an event procedure where it opens a snapshot of some data.
This recordset references a query.
I would like to remove the query and replace with SQL in the module but have
no idea how to do that!
I have added:
Dim strSQL as String
strSQL = "SQL Statement here.....".
DoCmd.RunSQL strSQL
I keep getting Runtime Error 3141 - The SELECT statement includes a reserved
word or an argument name that is misspelled or missing, or the punctuation is
incorrect.
This is the SQL from the query:
SELECT joinEmployeeTask.TaskID, "[" & [ServiceReqID] & "]" & " " &
[ServiceReqName] AS ServiceReq, tblEmployee.LastName, [FirstName] & " " &
[Lastname] AS Name, tblTask.Status, tblTask.Priority, tblTask.StartDate AS
TaskStart, Date() AS StartDate, tblTask.EndDate AS TaskEnd,
IIf([taskend]>Date()+91,Date()+97,[taskend]) AS EndTask,
DateDiff("d",Date(),[TaskEnd]) AS NoDays,
IIf(IsNull([AvgOfComplete]/100),0,[avgofcomplete]/100) AS Complete
FROM (tblTask LEFT JOIN qryTaskComplete ON tblTask.TaskID =
qryTaskComplete.TaskID) INNER JOIN (tblEmployee INNER JOIN joinEmployeeTask
ON tblEmployee.EmpID = joinEmployeeTask.EmpID) ON tblTask.TaskID =
joinEmployeeTask.TaskID
WHERE (((tblTask.StartDate) Is Not Null And (tblTask.StartDate)<Date()+84)
AND ((tblTask.EndDate) Is Not Null) AND ((tblTask.Current)=-1))
ORDER BY tblEmployee.LastName;
I think the problem lies with the LEFT JOIN....
Any help would be appreciated.
This recordset references a query.
I would like to remove the query and replace with SQL in the module but have
no idea how to do that!
I have added:
Dim strSQL as String
strSQL = "SQL Statement here.....".
DoCmd.RunSQL strSQL
I keep getting Runtime Error 3141 - The SELECT statement includes a reserved
word or an argument name that is misspelled or missing, or the punctuation is
incorrect.
This is the SQL from the query:
SELECT joinEmployeeTask.TaskID, "[" & [ServiceReqID] & "]" & " " &
[ServiceReqName] AS ServiceReq, tblEmployee.LastName, [FirstName] & " " &
[Lastname] AS Name, tblTask.Status, tblTask.Priority, tblTask.StartDate AS
TaskStart, Date() AS StartDate, tblTask.EndDate AS TaskEnd,
IIf([taskend]>Date()+91,Date()+97,[taskend]) AS EndTask,
DateDiff("d",Date(),[TaskEnd]) AS NoDays,
IIf(IsNull([AvgOfComplete]/100),0,[avgofcomplete]/100) AS Complete
FROM (tblTask LEFT JOIN qryTaskComplete ON tblTask.TaskID =
qryTaskComplete.TaskID) INNER JOIN (tblEmployee INNER JOIN joinEmployeeTask
ON tblEmployee.EmpID = joinEmployeeTask.EmpID) ON tblTask.TaskID =
joinEmployeeTask.TaskID
WHERE (((tblTask.StartDate) Is Not Null And (tblTask.StartDate)<Date()+84)
AND ((tblTask.EndDate) Is Not Null) AND ((tblTask.Current)=-1))
ORDER BY tblEmployee.LastName;
I think the problem lies with the LEFT JOIN....
Any help would be appreciated.