Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Access query date value

Posted on 2008-10-17
1
271 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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

789 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