Parameter Query

G

Guest

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
 
J

Jamie Collins

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.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top