::---:: Kalau mau return fungsi nya dalam format x th y bln z hr bikin aja fungsi dengan cara mengurangkan th_today - th_today bln_today - bln_lahir dan hr_today - hr_lahir
//contoh /**fungsi hitung usia nearest birthday***/ int b,li_usiamuth,li_usiamubl,li_usiahr,th1,th2,bl1,bl2,hr_ini,hr_lahir,li_umurmu string ls_hasil th1=Year(ad_skrg); th2=year(ad_tglahir); bl1=Month(ad_skrg); bl2=Month(ad_tglahir); hr_ini=day(ad_skrg); hr_lahir=day(ad_tglahir); //hitung usia_th,usia_bl utk reference fungsinya nih li_usiamuth=th1 - th2; li_usiamubl=bl1 - bl2; li_usiahr = hr_ini - hr_lahir ls_hasil = string(li_usiamuth,'##') + ' th ' + string(li_usiamubl,'##') + ' bl ' + string &(li_usiahr,'##') +'hr' return ls_hasil /****** tapi ls_hasil hanya akan return hasil pengurangan aja dan kalau misalnya yg dibutuhkan NEAREST birthday buatkan lagi kondisi seperti dibawah ini int blnmin if (bl1 < bl2) then blnmin = 12 - bl2 + bl1; li_usiamuth -= 1; end if if (bl1 > bl2) then blnmin = li_usiamubl; li_usiamuth = li_usiamuth; end if if (hr_ini < hr_lahir) then blnmin -=1; end if //set usianya /nearest birthday if (blnmin < 6) then li_umurmu=li_usiamuth; else li_umurmu=li_usiamuth+1; end if return li_umurmu ***********/ ---Selamat mencoba--- On Tue, 28 Sep 2004 19:41:16 -0000 "Hendra" <[EMAIL PROTECTED]> wrote: > Need help dong... > > ada yang tau Hitung Umur dari PowerBuilder gak ... > tapi Formatnya bukan days kaya 'daysafter' tapi >'..th..bln..hari' > trus databasenya kebetulan gw pake 'PSQL' > > sample... > > date tgl_lahir > today () > > a =1982-5-23 > > umur = today - tgl_lahir > > umurnya = '22 th 4 bln 6 hr' > > kalo ada sih function yg dari PBnya... > pernah pake gak.....? > > Mohon bantuan dari yang lebih Berpengalaman ... > > makasih ........ > > > > > > ------------------------ Yahoo! Groups Sponsor > > IndoPB - Indonesia PB User Group > To Post a message, send it to: [EMAIL PROTECTED] > To Unsubscribe,send a blank message to: >[EMAIL PROTECTED] > Yahoo! Groups Links > > > > > ---------------------------- Zimmy Fernando gurning +6281310026032 =========================================================================================== "Gabung INSTANIA, dapatkan XENIA. Daftar di www.telkomnetinstan.com, langsung dapat akses Internet Gratis.. Dan ..ikuti "Instan Smile" berhadiah Xenia,Tour S'pore, Komputer,dll, info hub : TELKOM Jatim 0-800-1-467826 " =========================================================================================== ------------------------ Yahoo! Groups Sponsor --------------------~--> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar. Now with Pop-Up Blocker. Get it for free! http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/NhFolB/TM --------------------------------------------------------------------~-> IndoPB - Indonesia PB User Group To Post a message, send it to: [EMAIL PROTECTED] To Unsubscribe,send a blank message to: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/indopb/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
