Hello,
I am getting the following error message when tryin to run the code listed below:
Server: Msg 241, Level 16, State 1, Line 1
Syntax error converting datetime from character string.
Code:
SELECT T1.EMPI, T1.DATE, T1.VALUE
FROM plmCombinedLab AS T1
WHERE T1.EMPI IN
(SELECT TOP 2 T2.Date
FROM plmCombinedLab As T2
WHERE T1.EMPI = T2.EMPI
ORDER BY T2.DATE DESC)
My date field is a datetime type in the SQL database. Could you please advise how and if I need to do some type of conversion?
Thank you.
I am getting the following error message when tryin to run the code listed below:
Server: Msg 241, Level 16, State 1, Line 1
Syntax error converting datetime from character string.
Code:
SELECT T1.EMPI, T1.DATE, T1.VALUE
FROM plmCombinedLab AS T1
WHERE T1.EMPI IN
(SELECT TOP 2 T2.Date
FROM plmCombinedLab As T2
WHERE T1.EMPI = T2.EMPI
ORDER BY T2.DATE DESC)
My date field is a datetime type in the SQL database. Could you please advise how and if I need to do some type of conversion?
Thank you.