Doreen-

Try this:

SELECT [Current Mo Pace PO wPct 2-24-06].pctTotSales, IIf([pctTotSales]
<0.98,0,DLookUp("[PctPayout1]","matrixTotSales1","[PctSlsTarAchd1] = " &
[pctTotSales])) AS value4
FROM [Current Mo Pace PO wPct 2-24-06]
GROUP BY [Current Mo Pace PO wPct 2-24-06].pctTotSales, IIf
([pctTotSales]<0.98,0,DLookUp
("[PctPayout1]","matrixTotSales1","[PctSlsTarAchd1] = " & [pctTotSales]));

John Viescas, author
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
Running Microsoft Access 2000
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
For the inside scoop on Access 2007, see:
http://blogs.msdn.com/access/


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of rokkeee
Sent: Thursday, April 20, 2006 11:42 AM
To: [email protected]
Subject: [ms_access] Dlookup function help

This should be so easy but I can't seem to get the results I'm looking
for while using the Dlookup function. I want to bring in a field from
another table that is not in my query.

Here's the SQL...can you see what I'm doing wrong?

SELECT [Current Mo Pace PO wPct 2-24-06].pctTotSales, IIf([pctTotSales]
<0.98,0,DLookUp("[PctPayout1]","matrixTotSales1","[PctSlsTarAchd1] =
[pctTotSales]")) AS value4
FROM [Current Mo Pace PO wPct 2-24-06]
GROUP BY [Current Mo Pace PO wPct 2-24-06].pctTotSales, IIf
([pctTotSales]<0.98,0,DLookUp
("[PctPayout1]","matrixTotSales1","[PctSlsTarAchd1] = [pctTotSales]"));

Thanks for your impending help!
Doreen







Yahoo! Groups Links











YAHOO! GROUPS LINKS




Reply via email to