Solved

Gognos : How to select latest date

Posted on 2013-12-21
2
384 Views
Last Modified: 2013-12-23
Hi All,

I generated a report to show customers outstanding balance with date. The issue that report is duplicating each customer showing multiable date and i found that latest date is the correct.

How can I filter date table to show only latest date only?

Thank you.
0
Comment
Question by:amq10
[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
2 Comments
 
LVL 6

Accepted Solution

by:
ButlerTechnology earned 500 total points
ID: 39734488
A sub-query in the where clause using the MAX function will allow you to get the last date.
Here's an example:
 Select * 
from Customer C inner join Purchase P
         on c.CustomerID = p.CustomerID
where p.PurchaseDate = (Select max(Purchasedate) from Purchase where CustomerID = c.CustomerID)

Open in new window


Tom
0
 

Author Closing Comment

by:amq10
ID: 39736414
it works, thank you
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 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