DATE FUNCTION

G

Guest

i have a field named "credit". each client has multiple credits on various
dates.

i want to create a field (function) that shows the credit amount of each
client but only at the most recent date. each client has a credit amount at
different dates.

which function do i have to use and how?

thank you in advance for your reply!!!
 
O

OfficeDev18 via AccessMonster.com

If your credits are cumulative, use

SELECT Client, Sum(Credits) As SumOfCredits FROM Table1 WHERE Client =
'YourClient' GROUP BY Client

If they aren't, use

SELECT Client, Max(CreditDateField) As MaxOfCreditDateField, Credit FROM
Table1 WHERE Client = 'YourClient' And CreditDateField = Max(CreditDateField)
GROUP BY Client, Credit

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top