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

I need help with Dlast function how It works

Status
Not open for further replies.

eli101

IS-IT--Management
Feb 1, 2001
54
US
I need help with Dlast function on how to use it for example I have three fields (1) Buy 2) Paid 3) TotalAmount) and I wont to get to total in the "TotalAmount" field by subtract it from the paid field, I also won the "TotalAmount" field shuld include the plus the prives total previs and what has left by the end (and to work this out I need to use this with the Dlast function but I don't know how if some one could please help me with this,thanks
 
First of all, you should not store calculated results in your database (there are a VERY few exceptions to this rule, and this ain't one of 'em ;-).

As for the DLast() function, it's usage is the same as every domain aggregate function. Keep in mind that is will return the last record in the recordset that meets the criteria(if any) that you define. Since most Access tables aren't ordered in the sense you may think, the last record isn't always the one you may think it is. For example, if you want the maximum value for a particular field for a specific customer DLast() would not be a good choice unless you used a query that sorted ascending on this specific field. In such a case, DMax() would be a better choice.

usage:

DLast("[FieldName]", "RecordSource", "[CriteriaFieldName] = 'Criteria'")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top