First, I am a novice to experienced beginner so bare with me.
I have a form that requires a start date and end date. I have made a combo box (on the same form) with list of the doctors to be selected as the criteria in a query. The query is not working. Here is the SQL:
"SELECT tblCodeStrokePts.CodeStrokeDate, tblCodeStrokePts.MRN, tblCodeStrokePts.ModeOfArrival, tblCSNeurologists.CSNeurologist, tblCodeStrokePts.PtIntubated, DateDiff("n",CDate([doordate] & " " & [doortime]),CDate([IVtPAStartdate] & " " & [IVtPAStarttime])) AS [Door to IV tPA]
FROM tblCSNeurologists INNER JOIN (tblCodeStrokePts INNER JOIN tblPatientCSNeurologists ON tblCodeStrokePts.CodeStrokeID = tblPatientCSNeurologists.CodeStrokeID) ON tblCSNeurologists.CSNeurKey = tblPatientCSNeurologists.CSNeurologist
WHERE (((tblCodeStrokePts.CodeStrokeDate) Between [Forms]![frmQuerySwitchboard]![txtStartDate] And [Forms]![frmQuerySwitchboard]![txtEndDate]) AND ((tblCSNeurologists.CSNeurologist)=[Forms]![frmQuerySwitchboard]![CSNeurologist]) AND ((tblCodeStrokePts.DoorDate) Is Not Null) AND ((tblCodeStrokePts.DoorTime) Is Not Null) AND ((tblCodeStrokePts.IVtPAStartDate) Is Not Null) AND ((tblCodeStrokePts.IVtPAStartTime) Is Not Null));"
I can not figure out what is wrong.
I welcome any help that I can get. Thank you!
I have a form that requires a start date and end date. I have made a combo box (on the same form) with list of the doctors to be selected as the criteria in a query. The query is not working. Here is the SQL:
"SELECT tblCodeStrokePts.CodeStrokeDate, tblCodeStrokePts.MRN, tblCodeStrokePts.ModeOfArrival, tblCSNeurologists.CSNeurologist, tblCodeStrokePts.PtIntubated, DateDiff("n",CDate([doordate] & " " & [doortime]),CDate([IVtPAStartdate] & " " & [IVtPAStarttime])) AS [Door to IV tPA]
FROM tblCSNeurologists INNER JOIN (tblCodeStrokePts INNER JOIN tblPatientCSNeurologists ON tblCodeStrokePts.CodeStrokeID = tblPatientCSNeurologists.CodeStrokeID) ON tblCSNeurologists.CSNeurKey = tblPatientCSNeurologists.CSNeurologist
WHERE (((tblCodeStrokePts.CodeStrokeDate) Between [Forms]![frmQuerySwitchboard]![txtStartDate] And [Forms]![frmQuerySwitchboard]![txtEndDate]) AND ((tblCSNeurologists.CSNeurologist)=[Forms]![frmQuerySwitchboard]![CSNeurologist]) AND ((tblCodeStrokePts.DoorDate) Is Not Null) AND ((tblCodeStrokePts.DoorTime) Is Not Null) AND ((tblCodeStrokePts.IVtPAStartDate) Is Not Null) AND ((tblCodeStrokePts.IVtPAStartTime) Is Not Null));"
I can not figure out what is wrong.
I welcome any help that I can get. Thank you!