this is the sql I am running

SELECT Manager, Rep, Format([Date],"yyyymmdd") & "Login" AS DateCat, LGON AS LogTime, DCount("*","FORMATTED_MASTER_DATA","Manager='" & [Manager] & "' AND Rep='" & [Rep] & "' AND [Date]=#" & [Date] & "# AND LGON<#" & [LGON] & "#")+1 AS Seq FROM FORMATTED_MASTER_DATA
UNION SELECT Manager, Rep, Format([Date],"yyyymmdd") & "Logout", LGOFF, DCount("*","FORMATTED_MASTER_DATA","Manager='" & [Manager] & "' AND Rep='" & [Rep] & "' AND [Date]=#" & [Date] & "# AND LGOFF<#" & [LGOFF] & "#")+1 FROM FORMATTED_MASTER_DATA;

What I have done is added an update statement to remove the apostrophe and it worked perfectly.