Hi,
I am trying to get a SUB Query to Show only loans with the Max Date. Here are the loans woith the original data ( Sorry that htis is meesed up but I did not know how to get this in here other wise).
LoanNum Date LoanBalance Borrower Name Bowwer Address BowwerCity Bowwer State Bowwer Zip
123 02-Jan-05 123.25 Jim Jones 12 Bars ave. Tonawanda NY 14228
123 15-Jan-05 1256.36 Jim Jones 12 Bars ave. Tonawanda NY 14228
123 12-Feb-05 125326.23 Jim Jones 12 Bars ave. Tonawanda NY 14228
124 01-Feb-05 78985.12 Bill Gates 14 Tennis Ln Buffalol NY 12456
124 15-Feb-05 256.36 Bill Gates 14 Tennis Ln Buffalol NY 12456
124 05-Feb-05 235.36 Bill Gates 14 Tennis Ln Buffalol NY 12456
I want to get it to this:
LoanNum MaxOfDate LoanBalance Borrower Name Bower Address Bower City Bower State Bowwer Zip
123 2/12/2005 125326.23 Jim Jones 12 Bars ave. Tonawanda NY 14228
124 2/15/2005 256.36 Bill Gates 14 Tennis Ln Buffalol NY 12456
This is my suub query that I have so far but it keeps wanting me to use the key word EXISTS , but if I do it doesnot work; it comes back Syntext error.
SELECT MaxDate.LoanNum, MaxDate.Date, MaxDate.LoanBalance, MaxDate.[Borrower Name], MaxDate.[Bowwer Address], MaxDate.BowwerCity, MaxDate.[Bowwer State], MaxDate.[Bowwer Zip]
FROM MaxDate
Where MaxDate.Date IN(SELECT MaxDate.LoanNum, Max(MaxDate.Date) From MaxDate);
Note: I can get the results I need by finding the max date loans by them selves and making a table of this. Then do ing a join between this table and the original table, I am looking for a more direct way.
Any help would be appreaciated.
Thank you
I am trying to get a SUB Query to Show only loans with the Max Date. Here are the loans woith the original data ( Sorry that htis is meesed up but I did not know how to get this in here other wise).
LoanNum Date LoanBalance Borrower Name Bowwer Address BowwerCity Bowwer State Bowwer Zip
123 02-Jan-05 123.25 Jim Jones 12 Bars ave. Tonawanda NY 14228
123 15-Jan-05 1256.36 Jim Jones 12 Bars ave. Tonawanda NY 14228
123 12-Feb-05 125326.23 Jim Jones 12 Bars ave. Tonawanda NY 14228
124 01-Feb-05 78985.12 Bill Gates 14 Tennis Ln Buffalol NY 12456
124 15-Feb-05 256.36 Bill Gates 14 Tennis Ln Buffalol NY 12456
124 05-Feb-05 235.36 Bill Gates 14 Tennis Ln Buffalol NY 12456
I want to get it to this:
LoanNum MaxOfDate LoanBalance Borrower Name Bower Address Bower City Bower State Bowwer Zip
123 2/12/2005 125326.23 Jim Jones 12 Bars ave. Tonawanda NY 14228
124 2/15/2005 256.36 Bill Gates 14 Tennis Ln Buffalol NY 12456
This is my suub query that I have so far but it keeps wanting me to use the key word EXISTS , but if I do it doesnot work; it comes back Syntext error.
SELECT MaxDate.LoanNum, MaxDate.Date, MaxDate.LoanBalance, MaxDate.[Borrower Name], MaxDate.[Bowwer Address], MaxDate.BowwerCity, MaxDate.[Bowwer State], MaxDate.[Bowwer Zip]
FROM MaxDate
Where MaxDate.Date IN(SELECT MaxDate.LoanNum, Max(MaxDate.Date) From MaxDate);
Note: I can get the results I need by finding the max date loans by them selves and making a table of this. Then do ing a join between this table and the original table, I am looking for a more direct way.
Any help would be appreaciated.
Thank you