Solved

Access query date value

Posted on 2008-10-17
1
269 Views
Last Modified: 2010-03-20
hello, I want my query to only list records where the field [CO].[ORDER_DATE] is not equal to the field [ PR].[DATE] plus 1-7 DAYS

please add it to my attached SQL, for me to copy/paste

thank you very much
SELECT COL.CUST_ORDER_ID AS [ordr ID], CO.ORDER_DATE AS [ordr date], CO.ORDER_DATE, PR.DATE

FROM Promoted AS PR RIGHT JOIN (SYSADM_CUSTOMER_ORDER AS CO INNER JOIN SYSADM_CUST_ORDER_LINE AS COL ON CO.ID = COL.CUST_ORDER_ID) ON PR.[PART #] = COL.PART_ID

ORDER BY COL.CUST_ORDER_ID;

Open in new window

0
Comment
Question by:gringotani
1 Comment
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 25 total points
Comment Utility
SELECT COL.CUST_ORDER_ID AS [ordr ID], CO.ORDER_DATE AS [ordr date], CO.ORDER_DATE, PR.DATE
FROM Promoted AS PR RIGHT JOIN (SYSADM_CUSTOMER_ORDER AS CO INNER JOIN SYSADM_CUST_ORDER_LINE AS COL ON CO.ID = COL.CUST_ORDER_ID) ON PR.[PART #] = COL.PART_ID
where ([co].[order_date] <= dateadd("d", 1, [pr].[date]) or [co].[date] > dateadd("d",7,[pr].[date]))
ORDER BY COL.CUST_ORDER_ID;
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now