Parameter Query

P

pjscott

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
 
J

Jason Lepack

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


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
 
K

KARL DEWEY

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 said:
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
 
P

pjscott

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 said:
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
 
K

KARL DEWEY

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


pjscott said:
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 said:
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
 
Top