query date by year

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i want to view report based on employee ID and by year selected.
I created report depend on table query.
what commad/SQL command for view employee by employee_ID and year ?
Screen input data
" please enter employee NO" and
screen second
"please enter year"
 
i want to view report based on employee ID and by year selected.
I created report depend on table query.
what commad/SQL command for view employee by employee_ID and year ?
Screen input data
" please enter employee NO" and
screen second
"please enter year"

I would use an unbound form to gather the information, and then have a
button to open the report with the filter you create...
Have a combobox for the employeeID's, and then either a textbox or
combobox for the year, and then a button that opens the report with
the filter....

You'd just build the filter and then pass it in the Open event of the
report.

Sub OpenMyFilteredReport()
Dim strFilter As String
strFilter = "[Year]=" & Me.Controls("cboYear") & " AND " & _
"[EmployeeID]=" & Me.Controls("cboEmployee")

DoCmd.OpenReport "MyReport", acViewPreview, , strFilter,
acWindowNormal
End Sub
 
my command SQL to view information is;
SELECT employee.no_id, employee.name, employee.department,
trainingrecord.course, trainingrecord.conducted, trainingrecord.date_in,
trainingrecord.date_out, trainingrecord.from, trainingrecord.to,
trainingrecord.total, trainingrecord.evaluation
FROM employee INNER JOIN trainingrecord ON employee.no_id =
trainingrecord.id_no
WHERE (((employee.no_id)=[Please Enter EMP No]))
ORDER BY employee.no_id, trainingrecord.date_in;

WHAT COMMAND NEED TO PUT ABOVE TO VIEW EMPLOYEE_ID AND BY YEAR?
Anyone can modify for me?
 
WHAT COMMAND NEED TO PUT ABOVE TO VIEW EMPLOYEE_ID AND BY YEAR?
Anyone can modify for me?

SELECT employee.no_id, employee.name, employee.department,
trainingrecord.course, trainingrecord.conducted, trainingrecord.date_in,
trainingrecord.date_out, trainingrecord.from, trainingrecord.to,
trainingrecord.total, trainingrecord.evaluation
FROM employee INNER JOIN trainingrecord ON employee.no_id =
trainingrecord.id_no
WHERE (((employee.no_id)=[Please Enter EMP No]))
AND trainingrecord.date_in >= DateSerial([Enter year:], 1, 1)
AND trainingrecord.date_in < DateSerial([Enter year:] + 1, 1, 1)
ORDER BY employee.no_id, trainingrecord.date_in;


John W. Vinson [MVP]
 
Back
Top