What type of SQL server and the datatype of Belegart, Barverkauf and Belegdatum?
I would try changing the date to 2016-09-16 00:00:00 and try again.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey Guy's
i have trouble with an sql server select query. My Error message:
When converting an nvarchar data type to a datetime data type, the value is out of range. (SQL: select top 1 * from [KHKVKBelege] where [Belegart] = Barverkauf and [Belegdatum] = 2016-09-16 00:00:00.000)
My Query:
$op = DB::connection('sqlsrv1')
->table('KHKVKBelege')
->where('Belegart', '=', 'Barverkauf')
->where('Belegdatum', '=', '2016-09-16 00:00:00.000')->first();
The value in the column (Belegdatum) is identical.
how do i format the value?
Anyone en Idea?
Please or to participate in this conversation.