الانتقال إلى المحتوى

Pls I Need Help In Date Function


khaleddn

Recommended Posts

Show the details of sales orders which are paid more than 14 days after the date of the sales order.


SQL:

SELECT SO.OrderID, D.DistributorID, D.FirstName, D.SurName, SO.OrderDate, P.PaymentDate, P.PaymentAmount
FROM SalesOrder AS SO, Distributor AS D, Payment AS P
WHERE D.DistributorID=SO.DistributorID AND SO.OrderID=P.OrderID AND
DateDiff('yyyy',PaymentDate,Date( ) ) - DateDiff('yyyy',OrderDate,Date( )) <=14;


WHEN I RUN THIS QUERY IT RETURN ALL THE VLAUES OF ORDER..BUT I WANT TO RETURN THE ORDERS WHICH IS PAID AFTER 14 DAYS OR MORE ?
AND I TIRED THIS TOO (date()-P.PaymentDate)>=14;

BUT IT DIDNT WORK :-(
ANY SUGGESTIONS ?PLS
this is in microsft access

رابط هذا التعليق
شارك

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية