Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal 9.0

Status
Not open for further replies.

monaamit

Technical User
Feb 11, 2005
14
US
Hi,

I am pullind data from ar_unpaid_bills, Sql table. In table I have four interst dates fields. i.e date1, date2, date3 and date4.All the fields are populated.I need to pull the latest date in my report. for example if date1 = 01/01/2006, date2 = 01/05/2006, Date3 = 01/09/2006 and date4 = 01/10/2003. I date on report will be 01/09/2006.

Thanks in advance for your help
Mona
 
Are you looking for a Crystal Reports solution? If so then you should probably repost in forum149 (Business Objects: Crystal Reports).
 
Make or have the DB admin make the following query on your SQL server.
Suppose the field for the invoice number is Inv, most likely the key of the table.

Select Inv, max (DateField)
From (
Select Inv, date1 as DateField from TheTable
Union all
Select Inv, date2 from TheTable
Union all
Select Inv, date3 from Thetable
Union all
Select inv, date4 from TheTable) as A
Group by Inv
Order by Inv

Link this query with the invoices table using the Invoice number and use the DateField in your report.


Jean-Paul
Montreal
To send me E-Mail, remove “USELESSCODE”.
jp@USELESSCODEsolutionsvba.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top