cade 0 Report post Posted June 18, 2004 dear all,camana nak kira bulan guna vbscript, aku sebenarnya dah lupa. Sample scenario: 27/5/1996 - 30/06/1996 dan jawapan nya dua bulancamana nak kira nih dalam vbscriptharap banyak membantusila reply ke email: [email protected] Quote Share this post Link to post Share on other sites
Rads78 0 Report post Posted June 18, 2004 Hi cade,Aku pun ingat-ingat lupa.. tapi nyatanya guna datediffstrMonth = DateDiff("m", "27/5/1996","30/06/1996")msgbox strMonthdia akan return 2.. kalau tak salah aku lar.. anyway bih kurang camtuh lar Quote Share this post Link to post Share on other sites
cade 0 Report post Posted June 18, 2004 lama tak dpt reply dari ko..apa khabar...code yg ko bagi tuh, dia return 1 jer lah....sblm nih aku ingt nak retrieve record lama kat putera.com. Las2 kena reconstruct lak...cheh...construct dah la amik masa lama lak tuh..Any way .....thnks Quote Share this post Link to post Share on other sites
akuBest 0 Report post Posted June 18, 2004 A'kum. errrr.. bulan lima ke bulan enam braper bulan? satu bulan ker 2 bulan?? tolong betulkan aku........ Quote Share this post Link to post Share on other sites
asp 0 Report post Posted June 18, 2004 strMonth = DateDiff("m", "27/5/1996","30/06/1996")msgbox strMonth+1 Quote Share this post Link to post Share on other sites
Rads78 0 Report post Posted June 18, 2004 Hi cade,Ok lar... aku biasa jerk aku pun tersasyul.................. 1 bulan ler hehhehe Quote Share this post Link to post Share on other sites
cade 0 Report post Posted June 27, 2004 tak jadi la code ko bg tu asp Quote Share this post Link to post Share on other sites
asp 0 Report post Posted June 29, 2004 apa yang takkena dgn code ni cade??aku buat ok je..cuba bukak notepad, save as fail.vbs lepas tu run kan fail tukalau nak buat dalam asp, perkataan "msgbox" tu kau tukar pada "response.write" dan tambah "<%" dan "%>" utk awal line dan last line.fail.vbs=======strMonth = DateDiff("m", "27/5/1996","30/06/1996")msgbox strMonth+1 fail.asp=====<%strMonth = DateDiff("m", "27/5/1996","30/06/1996")response.write strMonth+1 %>ok? complete tak explain tuwassalam.. Quote Share this post Link to post Share on other sites
cade 0 Report post Posted June 29, 2004 hohohoho.....nampaknyer sudah ok...jgn marah.....biasa ar ingat2 luper Quote Share this post Link to post Share on other sites
asp 0 Report post Posted June 29, 2004 aku tak marah, cuma geram kat lalat yg ada kat idung aku ni, Quote Share this post Link to post Share on other sites
darkranger 3 Report post Posted July 6, 2004 lagu satu jgn lupa.... format tarikh dlm VB ni ikut standard AmericanMM/DD/YY yg korang buat kat atas tu DD/MM/YYso coding tu cuba buat cam ni. taip dgn notepad save sbg cth: kira.vbsbulan=datediff("m", "7/30/1996", "9/30/1996")msgbox bulan & " bulan"Jawapan : 2 bulanP/S: aku baru tau rupanya boleh buat coding VBS terus pakai notepad je... Quote Share this post Link to post Share on other sites
cade 0 Report post Posted July 7, 2004 just pergi setting regional, then set kat sana....betulkan aku kalo salahaku rasa ada cara kalo nak ikut kita punya standard guna vb Quote Share this post Link to post Share on other sites
asp 0 Report post Posted July 9, 2004 darkranger,format tarikh tak ikut VB, tapi dia ikut regional setting dalam PC kitakalau dalam regional setting date dlm PC kita di set DD/MM/YYYY==========================================jawapan dibawah ialah 0 bulanbulan=datediff("m", "7/3/1996", "9/3/1996")msgbox bulan & " bulan"kalau dalam regional setting date dlm PC kita di set MM/DD/YYYY==========================================jawapan dibawah ialah 2 bulanbulan=datediff("m", "7/3/1996", "9/3/1996")msgbox bulan & " bulan"wassalam Quote Share this post Link to post Share on other sites