الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

استعلام بسيط من نوع متوسط القيمة

بدأه IT-Man في 3 نوفمبر 2013 · 0 رد · 588 مشاهدة · في قواعد بيانات Microsoft SQL Server
مشاركة: واتساب X فيسبوك تيليجرام
#1

AVG in Weeks

I have the following 2 tables which records every buying and selling of Goods as datetime

1- Selling Table
------------------------------------------------------
Date_of_Selling
------------------------------------------------------
15-9-2006
25-8-2007
13-8-2009
16-1-2009
22-1-2010
..
..

_______________________________________________
and here 2nd Table
2-Buying Table
----------------------------------------------------
Date_of_Buying
----------------------------------------------------
22-9-2004
25-16-2006
1-8-2010
22-8-2010
...
..
..


How can I find the average number of weeks between selling and buying ...
using timestampfunction or whatever ?
the result should be like : 5.3 weeks between selling and buying ,
Thanks in advance ...

مواضيع مشابهة