DLookup Again

Porky

Registered User.
Local time
Today, 22:11
Joined
Jul 1, 2005
Messages
15
I know there are lots of questions relating to this function but I ahve searched and cannot find an answer. Can I add a Dlookup to a field that calculates a sum of the fields based on todays date? I am not very good a coding so any help welcome. I guess I am asking if Dlookup can be combined with Sum and Date()
 
I have used:

=IIf(DSum("Total","qryTotalLabour","ServiceID = " & [ServiceID])>0,DSum("Total","qryTotalLabour","ServiceID = " & [ServiceID]),0)

This sums a query where the sum is greater than 0, else enters a 0 rather than displaying an error. So converting it to your situation.

=IIf(DSum("yourfield","yourtablename","datefield = #" & Date() & "#")>0,DSum("yourfield","yourtablename","datefield = #" & Date() & "#"),0)

HTH

Dave
 
perhaps Dsum would be better

Could I use DSum instead? I want to collect the total cash taken today from my Payments Table and display it in the cashing up form, based on a single table. I do have a query to total the cash based on date, but if I try to add this doesn't seem to work.
 

Users who are viewing this thread

Back
Top Bottom