My SQL statement Does not sort by Name. Is there another way to do this?
PARAMETERS prmEnd DateTime, prmStart DateTime;
INSERT INTO ztrptPendingScheduled ( ISInvID, Name, ContractID, Contract, StepID, StepName, StepDateStart, StepDateEnd, StepStatus )
SELECT tblPersons_steps.ISInvID, [InvLName] & ", " & [InvFname] AS Name, tblPersons.ContractID, TrefContract.Contract, tblPersons_Steps.StepID, trefSteps.StepName, tblPersons_Steps.StepDateStart, tblPersons_Steps.StepDateEnd, tblPersons_Steps.StepStatus
FROM trefSteps INNER JOIN ((trefContract INNER JOIN tblPersons ON trefContract.ContractID = tblPersons.ContractID) INNER JOIN tblPersons_Steps ON tblPersons.InvID = tblPersons_Steps.ISInvID) ON trefSteps.StepID = tblPersons_Steps.StepID
ORDER BY 2;
PARAMETERS prmEnd DateTime, prmStart DateTime;
INSERT INTO ztrptPendingScheduled ( ISInvID, Name, ContractID, Contract, StepID, StepName, StepDateStart, StepDateEnd, StepStatus )
SELECT tblPersons_steps.ISInvID, [InvLName] & ", " & [InvFname] AS Name, tblPersons.ContractID, TrefContract.Contract, tblPersons_Steps.StepID, trefSteps.StepName, tblPersons_Steps.StepDateStart, tblPersons_Steps.StepDateEnd, tblPersons_Steps.StepStatus
FROM trefSteps INNER JOIN ((trefContract INNER JOIN tblPersons ON trefContract.ContractID = tblPersons.ContractID) INNER JOIN tblPersons_Steps ON tblPersons.InvID = tblPersons_Steps.ISInvID) ON trefSteps.StepID = tblPersons_Steps.StepID
ORDER BY 2;