I am a complete Access beginner, and recently I have been trying to use Access to keep a log of expenses for staff at work (total to date for each staff, and total for each staff in the last 6 months).
I have a sub form in data sheet view that shows expenses by a staff, linked to the main form by StaffID (auto number). I have a text box in the in the sub form that calculates the total expenses to date for each staff which works fine (using =Sum([Payment]) in the sub form and then using =[subfrmPayment].[Form]![SumOfPayment] in the main form).
However for total expenses for each staff in the last 6 months I have tried using =DSum("Payment","tblPayment",DateDiff('d',[PaymentDate],Date())<180) in the same sub form and then using =[subfrmPayment].[Form]![6MonthPayment] in the main form. Unfortunately it calculates the total expenses for all staff for the last 6 months (or roughly 180 days), rather than for each staff.
Given that I have little knowledge about Access, is it possible to achieve the above without using VBA code?
Any advice for the above will be greatly appreciated!