Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Old 09-15-2011, 10:17 AM   #1
reklaw
Newly Registered User
 
Join Date: Sep 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
reklaw is on a distinguished road
Enter Parameter Value despite no Parameter in query

Hello, I think I have an issue that should be able to be solved in seconds but I cant find anything online or in this forum to help me. I have a query made using the Query Designer. In Field: CardsWithFuses: IIf([Device Definition].[DeviceType]="RTU",(-Int([IOwithfuses]/(-16))),(-Int([IOwithfuses]/(-32)))) Total: Group By The rest of the fields are blank. Just trying to achive a column heading of CardsWithFuses but Access comes up with a prompt to enter a value for CardsWithFuses. What am I doing wrong? Thanks in advance!

reklaw is offline   Reply With Quote
Old 09-15-2011, 10:20 AM   #2
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 33,376
Thanks: 13
Thanked 4,121 Times in 4,053 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Enter Parameter Value despite no Parameter in query

Because of the order the clauses are evaluated in, you can't use the alias in the group by clause. You can try switching to SQL view and change

GROUP BY CardsWithFuses

to

GROUP BY IIf([Device Definition].[DeviceType]="RTU",(-Int([IOwithfuses]/(-16))),(-Int([IOwithfuses]/(-32))))
__________________
Paul
Microsoft Access MVP 2007-2019

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Old 09-15-2011, 10:21 AM   #3
reklaw
Newly Registered User
 
Join Date: Sep 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
reklaw is on a distinguished road
Re: Enter Parameter Value despite no Parameter in query

I think I am doing the naming correctly but the CardsWithFuses column is used in a calculation in another column in the query builder. What order does the query execute? i.e. can the value for CardsWithFuses be populated before it is used elsewhere?

reklaw is offline   Reply With Quote
Old 09-15-2011, 10:24 AM   #4
reklaw
Newly Registered User
 
Join Date: Sep 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
reklaw is on a distinguished road
Re: Enter Parameter Value despite no Parameter in query

Quote:
Originally Posted by pbaldy View Post
Because of the order the clauses are evaluated in, you can't use the alias in the group by clause. You can try switching to SQL view and change

GROUP BY CardsWithFuses

to

GROUP BY IIf([Device Definition].[DeviceType]="RTU",(-Int([IOwithfuses]/(-16))),(-Int([IOwithfuses]/(-32))))
THanks for your quick response. The query designer has got it like the following: SELECT ... , IIf([Device Definition].[DeviceType]="RTU",(-Int([IO with fuses]/(-16))),(-Int([IO with fuses]/(-32)))) AS CardsWithFuses GROUP BY... , IIf([Device Definition].[DeviceType]="RTU",(-Int([IO with fuses]/(-16))),(-Int([IO with fuses]/(-32)))); So already under both select and group by
reklaw is offline   Reply With Quote
Old 09-15-2011, 10:28 AM   #5
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 33,376
Thanks: 13
Thanked 4,121 Times in 4,053 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Enter Parameter Value despite no Parameter in query

I haven't noticed a pattern, but sometimes you can use the alias in subsequent calculations and sometimes you can't. One workaround is to create a base query with that calculation in it and then base another query on that one and do the grouping and calculating there.
__________________
Paul
Microsoft Access MVP 2007-2019

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Old 09-15-2011, 10:34 AM   #6
reklaw
Newly Registered User
 
Join Date: Sep 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
reklaw is on a distinguished road
Re: Enter Parameter Value despite no Parameter in query

Quote:
Originally Posted by pbaldy View Post
I haven't noticed a pattern, but sometimes you can use the alias in subsequent calculations and sometimes you can't. One workaround is to create a base query with that calculation in it and then base another query on that one and do the grouping and calculating there.
Thanks for your help, seems as though if the column alias is to the left of where it is referenced in the query builder it doesnt pop-up with the parameter box. will confirm this after getting everything in the right order!

reklaw is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
'Enter Parameter Value' in Update Query hammer6 Queries 5 09-11-2009 01:52 AM
Enter Parameter Value problem in query uldis Queries 4 08-29-2008 02:22 AM
Enter Parameter Value knowledge76 Queries 6 06-08-2005 11:53 PM
Programatic parameter query based on parameter queries Cynoclast Modules & VBA 5 11-18-2004 01:24 PM
Query help - Enter Parameter Value piet123 Queries 2 05-25-2004 12:49 AM




All times are GMT -8. The time now is 07:36 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World