mmsalman87 بتاريخ: 9 نوفمبر 2009 تقديم بلاغ مشاركة بتاريخ: 9 نوفمبر 2009 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 اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
mustafagamiel بتاريخ: 9 نوفمبر 2009 تقديم بلاغ مشاركة بتاريخ: 9 نوفمبر 2009 السلام عليكم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 اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
homesick بتاريخ: 9 نوفمبر 2009 تقديم بلاغ مشاركة بتاريخ: 9 نوفمبر 2009 الله عليك مصطفى ،، استاذ اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
mmsalman87 بتاريخ: 9 نوفمبر 2009 كاتب الموضوع تقديم بلاغ مشاركة بتاريخ: 9 نوفمبر 2009 شكرا جزيلا لك يا اخ مصطفىوجعل الله علمك هذا في ميزان حسناتكمع خالص امنياتي وتحياتياخوك ماهر اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Recommended Posts
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.