Hard Mikh Hard Mikh - 2 years ago 97
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?

Answer Source
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download