If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > MAX function -1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-04, 15:29
mpc02 mpc02 is offline
Registered User
 
Join Date: Feb 2004
Location: London, UK
Posts: 1
Exclamation MAX function -1

Hi,

I am attempting to run a query that returns the most recent date, less on

i.e. in the following list the value 29/02/2004 would be returned, not because its the most recent value, but the value before the most recent value.

30/02/2004
29/02/2004
28/02/2004
27/02/2004
26/02/2004

I currently have the SQL:
SELECT dbo_tblDocuments.dCustomer, Max(dbo_tblDocuments.dDate) AS [Date of Last Order]
FROM dbo_tblDocuments
GROUP BY dbo_tblDocuments.dCustomer;

(where the field 'dCustomer' is the Customer's unique reference.)

HOW ON EARTH do I get the most recent value -1 to show?

Many thanks
Martyn
London
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On