Hard Mikh Hard Mikh - 5 months ago 17x
SQL Question

Using selectRaw with DATEADD

$data = Trjual_h::where('Kd_Pelanggan',$get)
->whereRaw('Nilai_Faktur-Nilai_Bayar > 0')
->selectRaw('Nilai_Faktur, Tgl_Faktur,DATEADD(day,Lama_Piutang,Tgl_Faktur) as Jatuh_Tempo, No_Faktur,Nilai_Bayar')

So the code return an error that state dateadd isn't a function. Lama_Piutang data type is tinyint(3) and Tgl_Faktur of course dateTime. So where did i do wrong?