I need to know how to do the following:
I need to know hot to setup table(s) so that I can query an EMPLOYEEID so that Whatever month in my calendar the user is on I can loop through the days in that current month and get a value for that day
eg..I setup a table called "EmpAttendance"
With "EntryID" as my PK
and the 3 fields...
"EmployeeID" -FK
"Date"
"Value"
But when I loop through the dates how do I know what value it will bring up?
eg..If the user is working in July,2004 there will be 31 days.
to loop through the days is easy...
For I = 1 to 31 step 1
txtdate(i).text = resultset
Next i
I tried the code:
SqlString = "SELECT Date From TblEmpAttendance WHERE Value In ('1','2','3','7','w') And TblEmployee.EmployeeID=TblEmpAttendance.EmployeeID AS resultset;"
which my vb tells me is bad sql syntax
If my table is set up correctly I just need the sqlcode
if not i need to know how to set up my table AND the sql code...
Any help would be highly appreciated!
Thanks!!!
I need to know hot to setup table(s) so that I can query an EMPLOYEEID so that Whatever month in my calendar the user is on I can loop through the days in that current month and get a value for that day
eg..I setup a table called "EmpAttendance"
With "EntryID" as my PK
and the 3 fields...
"EmployeeID" -FK
"Date"
"Value"
But when I loop through the dates how do I know what value it will bring up?
eg..If the user is working in July,2004 there will be 31 days.
to loop through the days is easy...
For I = 1 to 31 step 1
txtdate(i).text = resultset
Next i
I tried the code:
SqlString = "SELECT Date From TblEmpAttendance WHERE Value In ('1','2','3','7','w') And TblEmployee.EmployeeID=TblEmpAttendance.EmployeeID AS resultset;"
which my vb tells me is bad sql syntax
If my table is set up correctly I just need the sqlcode
if not i need to know how to set up my table AND the sql code...
Any help would be highly appreciated!
Thanks!!!