Solved

Access query date value

Posted on 2008-10-17
1
273 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
[X]
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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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