I have some difficulties in laravel query builder.
I have a syntax like this :
$data['tmasuk'] =TSediam::where('kd_lokasi', $kd_lokasi)->where('kd_brg', $kd_brg)->where('DATEPART(YYYY,tgldok)',$tgldok)->get();
it says error
An uncaught Exception was encountered Type: Illuminate\Database\QueryException Message: SQLSTATE[42S22]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid column name 'DATEPART(YYYY,tgldok)'. (SQL: select * from [t_sediam] where [kd_lokasi] = 023040500414964000KD and [kd_brg] = 1010302001000001 and [DATEPART(YYYY,tgldok)] = 2015) Filename: C:\wamp\www\sedia\vendor\illuminate\database\Connection.php Line Number: 651
**
But, if I check the query via sql server management studio it's work
select * from [t_sediam] where [kd_lokasi] = '023040500414964000KD' and [kd_brg] = '1010302001000001' and DATEPART(YYYY,tgldok) = '2015'
So, what is the solution? thanks