I have the following sql:
select CONVERT(date,visitorannouncements.DateOfVisit), visitorannouncements.Agent,
Firstname, visitors.Lastname
from Visitors
LEFT JOIN visitorannouncements
ON Visitors.VisitorAnnouncementId=visitorannouncements.Id
where ship = @shipname
AND convert(datetime, visitorannouncements.DateOfVisit,101) BETWEEN @startDate AND @endDate
The visitorannouncements.DateOfVisit is nvarchar field.
I get the following error:
TITLE: Microsoft SQL Server Report Builder
An error occurred while reading data from the query result set. The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value.
ADDITIONAL INFORMATION:
The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value. (Microsoft SQL Server, Error: 242)