Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Question!!!!!!!!

Status
Not open for further replies.

quest4

Technical User
Aug 27, 2001
735
US
In an Access2000 Select Query, can you use or declare a numeric variable? Thanks for any help in advance.
 
Not in the query window.
Why do you need to set up a variable?

Nick
 
Actually it is part of q select query where if I get a true response, I want to alter the variable and increase the duration. I intend to get to that next week. For now, I did figure out that I can use PARAMETERS to set thi up, at least I think so. I tried this:
PARAMETERS [RptDur] Integer;
Then I added this:
WHERE ([RptDur]=-14)

I get a pop-up window, which I don't want, but if I enter the -14, I get the correct results. So my question is how can I set a default? Thank you for your response.
 
Yhe whole query gets a little long so I think I'll just do the top part:

PARAMETERS [RptDur] Long;
SELECT Att.EmployeeNumber,
Emp.NameFirst, Emp.NameInitial,
Emp.NameLast,
COUNT(Att.EmployeeNumber) AS RecCnt
FROM tblEmployees AS Emp LEFT JOIN tblAttendence AS Att
ON Emp.EmployeeNumber=Att.EmployeeNumber
WHERE ([RptDur]=-14)
And (Emp.EmpStatusType="Active" And
Emp.PayType="per Hour")
And(Att.DateWeekStarting Between Nz([Enter Start Date],DateAdd("ww",[RptDur],Date()))
And Dateadd("ww",(([RptDur]*-1)-1),Nz([Enter Start Date],DateAdd("ww",[RptDur],Date()))))

Of course it does go on but I think that this should give you an idea of where I am trying to eventually go. Thanks the the response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top