By the way, I purchased one of your books recently "Building Microsoft Access Applications" but didn't have it at work today!
John Viescas <[EMAIL PROTECTED]> wrote: 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
Visit your group "ms_access" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
[Non-text portions of this message have been removed]
YAHOO! GROUPS LINKS
- Visit your group "ms_access" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
