Hello,
I am trying to group some rows of data so I get the most recent value. Tried to use a substring but received this error. Any help will be greatly appreciated.
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting date and/or time from character string.
I am trying to group some rows of data so I get the most recent value. Tried to use a substring but received this error. Any help will be greatly appreciated.
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting date and/or time from character string.
SQL:
select
Audit_Tool.*
from
(select patientid, max(EntryDate) as EntryDate
from Audit_Tool group by patientid) as lastest_entry
inner join Audit_Tool
on Audit_Tool.patientID = lastest_entry.patientID and
Audit_Tool.EntryDate = lastest_entry.patientID