Can some help with this select statment. Recently I posted an issue and I have been trying to follow the advice but cant get this select string to work.
strSql = "SELECT RepairHistoryTable.SerialNum, DeviceHistoryTable.[On Repair] as OnRepair, Max(RepairHistoryTable.SentDate) FROM RepairHistoryTable INNER JOIN DeviceHistoryTable ON RepairHistoryTable.SerialNum = DeviceHistoryTable.SerialNum" & _
" GROUP BY RepairHistoryTable.SerialNum, DeviceHistoryTable.[On Repair]" & _
" HAVING (((DeviceHistoryTable.[On Repair]= True ));"
Tried also changing the Have portion to:
"Having ((DeviceHistoryTable.[On Repair] = " & True & "));"
but I get expected end of statement.
I am trying to grab all information from tblrepair that whose SerialNum in tblDeviceHistoryTable is on repair and only the last instance if the record in tblRepair.
Thanks!
strSql = "SELECT RepairHistoryTable.SerialNum, DeviceHistoryTable.[On Repair] as OnRepair, Max(RepairHistoryTable.SentDate) FROM RepairHistoryTable INNER JOIN DeviceHistoryTable ON RepairHistoryTable.SerialNum = DeviceHistoryTable.SerialNum" & _
" GROUP BY RepairHistoryTable.SerialNum, DeviceHistoryTable.[On Repair]" & _
" HAVING (((DeviceHistoryTable.[On Repair]= True ));"
Tried also changing the Have portion to:
"Having ((DeviceHistoryTable.[On Repair] = " & True & "));"
but I get expected end of statement.
I am trying to grab all information from tblrepair that whose SerialNum in tblDeviceHistoryTable is on repair and only the last instance if the record in tblRepair.
Thanks!