logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Tom Van Overbeke  
#1 Posted : Friday, November 15, 2019 2:18:41 PM(UTC)
Tom Van Overbeke

Rank: Member

Groups: Registered
Joined: 10/23/2019(UTC)
Posts: 11
Belgium

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
epf  
#2 Posted : Friday, November 15, 2019 2:45:49 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 205 time(s) in 198 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).
Users browsing this topic
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.