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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|