special sql string for rollcall
Hello
the personels who works in oil rig, 14 days work. and 14 days rest.
some of personels are Fixed and some of personels are not Fixed (Offset, or Alternative. I do not know what the English equivalent is)
i wants to design a database for rollcall (Attendance).
it is necessary to save records of personels who are not Fixed. but the fixed personels should not be saved in daily rollcall db.
because it Leads to exacerbation (Expanded). only the daily record of personels who are not Fixed must be saved in db.
now how can i get a sql string for data of a personels who are Fixed.
i have 2 tables.
first table have specifications of personels.(Fields: name, family, personelCode, FixedOrNot)
and secode have record of rollcall..(Fields: personelCode, DateOfWork, RigName)
Thanks
Re: special sql string for rollcall
Code:
Select * from personels P inner join
----Or left join, depends if it has a personelCode---
rollcall R on P.personelCode = R.personelCode
where P.FixedOrNot = 'Fixed' ---- or FixedOrNot = True or FixedOrNot = 1 , depends of your column definition.
Re: special sql string for rollcall
well the program communicating with the DB can specify if they are fixed or not........ otherwise how can you tell????
if u cannot modify the program then find out what data it is sending and use that in the query to decide if a table needs updating or not using the WHERE clause....