بتاريخ: 9 نوفمبر 200916 سنة comment_175939 hi alli am trying to write query that discount the number of friday days between two days How ?examplefrom_date = 21/10/2009to_date = 2/11/2009the result should be(to_date - from_date ) - number of friday days between two daysthanks in advanced تقديم بلاغ
بتاريخ: 9 نوفمبر 200916 سنة comment_175943 السلام عليكمyou can try with this function create or replace function fri_bet (date1 date,date2 date ) return number as day_bet number; day number; fri_count number :=0; begin select date2-date1 into day_bet from dual; for i in 1.. day_bet+1 loop select to_char(date1-1+i,'d') into day from dual; if day=7 then fri_count:=fri_count+1; end if; end loop; return(fri_count); end; the query select fri_bet(to_date('30/10/09','dd/mm/yy'),to_date('06/11/09','dd/mm/yy')) from dual; good luck تقديم بلاغ
بتاريخ: 9 نوفمبر 200916 سنة كاتب الموضوع comment_175957 شكرا جزيلا لك يا اخ مصطفىوجعل الله علمك هذا في ميزان حسناتكمع خالص امنياتي وتحياتياخوك ماهر تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.