I have a table with two columns, memberID (integer) and paidThru (date). I'm
using SQL 2000.
Most rows have only one member ID associated with one paidThru date.
Problem is, some of the records have one memberID which can be associated
with two or more paidThru dates (the multiple dates per member ID would not
be duplicates (not be the same date).
 
What I want to do is return the most recent date only and its associated
memberID for all records.
I'm stumped on how to do this correctly. I've tried distinct, group by, and
max without success.
 
 <cfquery name="getTransactions" datasource="myDataSource">
  SELECT memberID, paidThru 
  FROM someTableName  
  ORDER BY memberID asc 
 </cfquery>
 
Thanks in advance.
 
Mark




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:199280
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to