DELETE FROM inbox where convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-7,getdate()),121)
DELETE FROM outbox where convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-7,getdate()),121)
DELETE FROM transaksi where convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-7,getdate()),121)
DELETE FROM mutasi where convert(char(19),tanggal,121) < convert(char(19),dateadd(Day,-7,getdate()),121)
DELETE FROM log_sistem where convert(char(19),waktu,121) < convert(char(19),dateadd(Day,-7,getdate()),121)
DELETE FROM outbox WHERE prioritas='5' AND Convert(char, tgl_entri,101) < Convert(char, getdate(),101)
DELETE from outbox where Convert(char, tgl_entri,101) < Convert(char, getdate(),101) AND penerima not in (select pengirim from pengirim) AND kode_reseller IN (select kode from reseller)
Update outbox SET modul_proses = NULL WHERE status > '1' and status < '20' and kode_reseller IN (SELECT kode FROM reseller)
Delete from dbo.modul where deleted = 1
Delete from dbo.sms_center where deleted = 1
Delete from dbo.sms_sender where deleted = 1
Delete from dbo.terminal where deleted = 1
DELETE FROM fisik where status = '2' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-20,getdate()),121)
DELETE FROM data_bank where convert(char(19),tgl_proses,121) < convert(char(19),dateadd(Day,-20,getdate()),121)
DELETE FROM tiket_deposit where convert(char(19),waktu,121) < convert(char(19),dateadd(Day,-20,getdate()),121)
DELETE FROM TransLog where convert(char(19),date,121) < convert(char(19),dateadd(Day,0,getdate()),121)
Update reseller SET aktif='0'
WHERE convert(char(19),tgl_aktivitas,121) < convert(char(19),dateadd(Day,-60,getdate()),121)
AND saldo < '5000'
OR (tgl_aktivitas IS NULL AND convert(char(19),tgl_daftar,121) < convert(char(19),dateadd(Day,-60,getdate()),121))
DELETE FROM inbox where status='21' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-4,getdate()),121)
DELETE FROM inbox where status='23' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-4,getdate()),121)
DELETE FROM inbox where status='41' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-4,getdate()),121)
DELETE FROM inbox where status='42' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-4,getdate()),121)
DELETE FROM inbox where status='43' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-4,getdate()),121)
DELETE FROM inbox where status='44' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-4,getdate()),121)
DELETE FROM inbox where status='46' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-4,getdate()),121)
DELETE FROM inbox where status='47' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-4,getdate()),121)
DELETE FROM inbox where status='50' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-4,getdate()),121)
DELETE FROM inbox where status='52' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-4,getdate()),121)
DELETE FROM outbox where kode_transaksi='-1' and convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-4,getdate()),121)
DELETE FROM outbox where penerima='dial' an ;Dd convert(char(19),tgl_entri,121) < convert(char(19),dateadd(Day,-5,getdate()),121)
fungsi dan mksd masing 2 di atas ini
bisa tolong di jabar kan bos , ada yg tau penjelasan nya ?