Seal Report Forum
»
Report Edition
»
Reports
»
Date field not working as expected
Rank: Member
Groups: Registered
Joined: 10/23/2019(UTC) Posts: 11
|
Hi, I have a connection with a sql server source. The report works fine, but I have a bit of problem with a date field. The select query is as follows: Code:select customer.CustomerName,
OutgoingSessionDelivery.DeliveryNumber,
carrier.Code,
OutgoingSessionDelivery.CarrierRemarks,
OutgoingSessionDelivery.SessionId,
cast(OutgoingSession.ChangeDate as date) as LeverDatum,
OutgoingSession.CreateUser,
outgoingserial.Quantity * article.GrossWeight as BrutoGewicht
from OutgoingDetails
left join OutgoingSessionDelivery on OutgoingDetails.SessionId = OutgoingSessionDelivery.SessionId
left join OutgoingSession on OutgoingDetails.SessionId = OutgoingSession.Id
left join Carrier on OutgoingSessionDelivery.CarrierId = carrier.Id
left join Article on OutgoingDetails.ArticleId = Article.Id
left join Customer on OutgoingSessionDelivery.CustomerId = customer.Id
left join OutgoingLocation on OutgoingDetails.id = OutgoingLocation.OutgoingDetailsId
left join OutgoingSerial on OutgoingLocation.Id = OutgoingSerial.OutgoingLocationId
My question is about the changedate (leverdatum) field. As far as I can see, it's a Date field. but I tried to add a restriction to this field, using the example 2 'restrictions' of the seal report sample files. This I how I set it up: [img=https://postimg.cc/NKz4cdkw]image[/img] I got this error: Error detail: Conversion failed when converting date and/or time from character string. 15:10:31 Rendering report... So apparently it's not a date field? I tried to 'force' it via the options window - Data type (I changed it to "Date & time" instead of default) but still no luck. Can someone guide me in the right direction please? Thanks, Tom
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
It seems to be a SQLServer error: cast(OutgoingSession.ChangeDate as date) may not work for certain values... Check the SQL Generated in SQL Management Studio first (copy/paste the SQL then execute).
|
|
|
|
Seal Report Forum
»
Report Edition
»
Reports
»
Date field not working as expected
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.