atomic 3 Report post Posted December 2, 2014 Salam untuk semua.. mohon bantuan,dah cuba tapi masih gagal.. contoh code : CREATE TABLE #temptable (id int,nm varchar(20),tarikh datetime); INSERT INTO #temptable VALUES (1001,'Hakim','2/12/2010'); SELECT * FROM #temptable; --DROP TABLE #temptable; soalan,macam mana saya nak compare fields 'tarikh' dengan 'gatedate()'? saya cuba macam ni,tapi gagal.. SELECT nm,tarikh= CASE tarikh WHEN tarikh <= getdate() THEN 'Aktif' ELSE 'Tidak Aktif' END FROM #temptable; Mohon bantuan.. Terima kasih. Quote Share this post Link to post Share on other sites
umarzuki 78 Report post Posted December 3, 2014 mungkin boleh guna language yang boleh run sql cth: bash lepas tu guna la for loop atau yang sesuai Quote Share this post Link to post Share on other sites
atomic 3 Report post Posted December 3, 2014 saya guna .net,tp tak tau macam mana nak buat dalam gridview time data bind..itu yg terfikir nak buat kat sql jer.. Quote Share this post Link to post Share on other sites
Chuki2 32 Report post Posted December 7, 2014 Try pakai command ini WHEN tarikh <= cast(cast(getdate() as date) as datetime) Quote Share this post Link to post Share on other sites
atomic 3 Report post Posted December 10, 2014 Try pakai command ini WHEN tarikh <= cast(cast(getdate() as date) as datetime) thanks sifu... :) Quote Share this post Link to post Share on other sites