Solved

Enter Parameter Value

Posted on 2006-11-11
4
430 Views
Last Modified: 2012-05-05
When I run the following statement I receive "enter parameter Value" qrymuliplier?  Qrymultiplier1 is a calculated field in a query.  When I press "OK" on the "enter parameter value" the query runs fine and the results are correct.  I'm not sure if this is the cause but the query does have null values in the qryMultiplier field.

SELECT DLookUp("Multiplier","tblSummary","profile=401 and FromDate<=#" & [dtProfile] & "# And ToDate>=#" & [dtProfile] & "#") AS qryMultiplier1, tblProfile.dtProfile, tblProfile.H1, tblProfile.ProfileNumber, [qryMultiplier1]*[H1] AS S_H1
FROM tblProfile, tblSummary
GROUP BY tblProfile.dtProfile, tblProfile.H1, tblProfile.ProfileNumber, [qryMultiplier1]*[H1]
HAVING (((tblProfile.ProfileNumber)=401));

Thanks...John
0
Comment
Question by:jfringer
  • 2
4 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
ID: 17922600


try


SELECT DLookUp("Multiplier","tblSummary","profile=401 and FromDate<=#" & [dtProfile] & "# And ToDate>=#" & [dtProfile] & "#") AS qryMultiplier1, tblProfile.dtProfile, tblProfile.H1, tblProfile.ProfileNumber, [qryMultiplier1]*[H1] AS S_H1
FROM tblProfile, tblSummary
GROUP BY tblProfile.dtProfile, tblProfile.H1, tblProfile.ProfileNumber, DLookUp("Multiplier","tblSummary","profile=401 and FromDate<=#" & [dtProfile] & "# And ToDate>=#" & [dtProfile] & "#") *[H1]
HAVING (((tblProfile.ProfileNumber)=401));
0
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 17922603
Have you tried just omitting   [qryMultiplier1]*[H1]   from your Group By clause?
 
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17922616
why have group by's when u dont have any aggregate functions

u could just DISTINCT?


SELECT DISTINCT DLookUp("Multiplier","tblSummary","profile=401 and FromDate<=#" & [dtProfile] & "# And ToDate>=#" & [dtProfile] & "#") AS qryMultiplier1, tblProfile.dtProfile, tblProfile.H1, tblProfile.ProfileNumber, [qryMultiplier1]*[H1] AS S_H1
FROM tblProfile, tblSummary
WHERE tblProfile.ProfileNumber=401



But u may need to repeate your DLOOKUP instead of using qryMultiplier1

0
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 17922635
I had a feeling you'd accept Cap's answer straight away - and it would indeed work.
(And I don't mind - as I said, it does work and it was first).

I'd considered it, but held off from it and I didn't post that suggestion for a reason.
Firstly, it's an extra hit on the function to grab that data again.
But fundamentally, it's based on data that is already grouped.
So it shouldn't change anything by ommitting it.

All I'm saying is give it a go - it should be quicker :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now