A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Parameter Query



 
 
Thread Tools Display Modes
  #1  
Old February 27th, 2007, 06:55 PM posted to microsoft.public.access.queries
pjscott
external usenet poster
 
Posts: 38
Default Parameter Query

I have query that converts the months of service to years.

Years: [a_mo_serv] / 12

The user wants to display a list that's =.

I created a parameter query with the following:

=[Enter number of years]


When I run the query I enter 10 and I get a list of everyone. Can someone
please tell me what I'm doing wrong?

Thanks,

Paul

  #2  
Old February 27th, 2007, 07:00 PM posted to microsoft.public.access.queries
Jason Lepack
external usenet poster
 
Posts: 600
Default Parameter Query

Go into SQL View in your query editor, copy the text that's in there
and paste it here so we can help you.


On Feb 27, 1:55 pm, pjscott wrote:
I have query that converts the months of service to years.

Years: [a_mo_serv] / 12

The user wants to display a list that's =.

I created a parameter query with the following:

=[Enter number of years]


When I run the query I enter 10 and I get a list of everyone. Can someone
please tell me what I'm doing wrong?

Thanks,

Paul



  #3  
Old February 27th, 2007, 07:04 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Parameter Query

Post your SQL statement by opening the query in design view and clicking on
menu VIEW - SQL View. Highlight, copy, and paste in a post.
--
KARL DEWEY
Build a little - Test a little


"pjscott" wrote:

I have query that converts the months of service to years.

Years: [a_mo_serv] / 12

The user wants to display a list that's =.

I created a parameter query with the following:

=[Enter number of years]


When I run the query I enter 10 and I get a list of everyone. Can someone
please tell me what I'm doing wrong?

Thanks,

Paul

  #4  
Old February 27th, 2007, 07:10 PM posted to microsoft.public.access.queries
pjscott
external usenet poster
 
Posts: 38
Default Parameter Query

SELECT [lname] & ", " & [fname] & " " & [init] AS Name, [a_mo_serv]/12 AS Years
FROM EmpData
WHERE ((([a_mo_serv]/12)=[Number of Years]))
ORDER BY [lname] & ", " & [fname] & " " & [init];

Hope this helps,

Thanks,

Paul

"pjscott" wrote:

I have query that converts the months of service to years.

Years: [a_mo_serv] / 12

The user wants to display a list that's =.

I created a parameter query with the following:

=[Enter number of years]


When I run the query I enter 10 and I get a list of everyone. Can someone
please tell me what I'm doing wrong?

Thanks,

Paul

  #5  
Old February 28th, 2007, 12:17 AM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Parameter Query

Your query works for me. Maybe post some sample data.
--
KARL DEWEY
Build a little - Test a little


"pjscott" wrote:

SELECT [lname] & ", " & [fname] & " " & [init] AS Name, [a_mo_serv]/12 AS Years
FROM EmpData
WHERE ((([a_mo_serv]/12)=[Number of Years]))
ORDER BY [lname] & ", " & [fname] & " " & [init];

Hope this helps,

Thanks,

Paul

"pjscott" wrote:

I have query that converts the months of service to years.

Years: [a_mo_serv] / 12

The user wants to display a list that's =.

I created a parameter query with the following:

=[Enter number of years]


When I run the query I enter 10 and I get a list of everyone. Can someone
please tell me what I'm doing wrong?

Thanks,

Paul

  #6  
Old February 28th, 2007, 01:52 PM posted to microsoft.public.access.queries
Jamie Collins
external usenet poster
 
Posts: 1,705
Default Parameter Query

On Feb 27, 7:10 pm, pjscott wrote:
SELECT [lname] & ", " & [fname] & " " & [init] AS Name, [a_mo_serv]/12 AS Years
FROM EmpData
WHERE ((([a_mo_serv]/12)=[Number of Years]))
ORDER BY [lname] & ", " & [fname] & " " & [init];


Perhaps you want the \ operator rather than / e.g.

WHERE a_mo_serv \ 12 = [Number of Years]

Jamie.

--


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.