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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Complex Query

Status
Not open for further replies.

Brogrim

Technical User
Jul 28, 2000
184
0
0
IE
I have 2 tables that I want to build a complex query off

tblBadgeMemberDuplicates
MemberID (PK)

tblBadge
MemberID (FK)
DateOfIssue
DateOfExpiry

Each member has 2 badges in tblbadge, I want to filter 1 badge for each member, I want the badge to be the one with the highest date in the date of issue field.

Thanks

 
A starting point (SQL code):
SELECT MemberID, Max(DateOfIssue) AS LastIssue
FROM tblBadge
GROUP BY MemberID

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top