Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Find when the last time you received an order from a list of vendors in Crystal Reports or SQL

Posted on 2017-06-14
1
Medium Priority
?
29 Views
Last Modified: 2017-06-14
Our company has thousands of different vendors in its ERP system.  Many of them we no longer use.  I'm trying to figure out the best way for me to create a report that will show me a distinct list of suppliers that we have used.  Or a way to show the last time something was purchased or received from a vendor.  I can use SQL, Crystal Reports or Excel to create this but would need the thought process of what to filter the report on.   My goal is to review vendors where we have not had usage from say the past three years and eliminate them from our database.
0
Comment
Question by:ITworks
[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 27

Accepted Solution

by:
Chris Luttrell earned 2000 total points
ID: 42177276
A few clues as to what your tables and data are like would be a huge help here.  But this is the jest of what you need to find that kind of data.
select V.Vendor, MAX(O.OrderDate) LastOrder
from VendorTable V
left outer join OrderTable O on V.ID = O.VendorID
order by MAX(O.OrderDate)
having MAX(O.OrderDate) > dateadd(YEAR, -3, CURRENT_TIMESTAMP)

Open in new window

0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

609 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