Solved

Access query date value

Posted on 2008-10-17
1
270 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
ID: 22746896
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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 …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 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