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

DSum or DLookup

Status
Not open for further replies.

misscrf

Technical User
Jun 7, 2004
1,344
US
Can someone please help me with what is wrong in this formula? I am looking up a value in a table, to sum it in a report footer.

Code:
=(0.04)*DSum([SumOfpagecount],"tblmylinktable0708-0409","[tblmylinktable0708-0409]![cid] = Reports!rptMyReport![cid]")

When I try to run the report, I get asked to fill in a parameter for [SumOfpagecount]. This is the actual column name from the table.

Thanks!

misscrf

It is never too late to become what you could have been ~ George Eliot
 
try

=(0.04)*DSum("[SumOfpagecount]","tblmylinktable0708-0409","[tblmylinktable0708-0409]![cid] =" & Reports!rptMyReport![cid]")
 
close, but I think a doublequote is off. when i tried that it gave me a syntax error, and I tried to correct the quotes at the end. Now it runs, but is blank...

misscrf

It is never too late to become what you could have been ~ George Eliot
 
ok, I ended up getting this to work in the CID footer:

Code:
=(0.04)*DSum("[SumOfpagecount]","tblmylinktable0708-0409")

Now my issue is that I need to limit this to a range of dates. In the tblmylinktable0708-0409 there is a field called myimportdate. I need to limit this to myimportdate between 01/01/09 and 04/04/09. I have tried a bunch of different ways, but for some reason this formula cracks up whenever I add any type of criteria. Very tempermental!!! lol.

I appreciate your help.

misscrf

It is never too late to become what you could have been ~ George Eliot
 
try
Code:
=(0.04)*DSum("[SumOfpagecount]","tblmylinktable0708-0409","myimportdate between #01/01/09# and #04/04/09#")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top