select personnel.personnel_id, personnel.reg_job, member.vacation_max
,DATEDIFF(year,(year(personnel.reg_job)),(year(GETDATE())+'543')) as years
,DATEDIFF(year,(year(2554-01-02)),(year(GETDATE())+'543')) as years1
,month(CONVERT(VARCHAR(24),personnel.reg_job,105)) as monthStartJob
from member,personnel
where member.id_card=personnel.id_card
and personnel.personnel_id = '5500987'
select personnel.personnel_id, personnel.reg_job, member.vacation_max
,DATEDIFF(year(personnel.reg_job),( year(GETDATE())+'543') ) as years
,DATEDIFF(year(2554-01-02), ( year(GETDATE())+'543') ) as years1
,month(CONVERT(VARCHAR(24),personnel.reg_job,105)) as monthStartJob
from member,personnel
where member.id_card=personnel.id_card
and personnel.personnel_id = '5500987'
select personnel.personnel_id, personnel.reg_job, member.vacation_max
,DATEDIFF(yyyy, year(personnel.reg_job),( year(GETDATE())+'543') ) as years
,DATEDIFF(yyyy, year(2554-01-02), ( year(GETDATE())+'543') ) as years1
,month(CONVERT(VARCHAR(24),personnel.reg_job,105)) as monthStartJob
from member,personnel
where member.id_card=personnel.id_card
and personnel.personnel_id = '5500987'
select personnel.personnel_id, personnel.reg_job, member.vacation_max ,DATEDIFF(yyyy , dateadd(year, 543 ,curdate( )) ,personnel.reg_job) as years
,DATEDIFF(yyyy , year(2554-01-02) , ( year(GETDATE())+'543') ) as years1
,month(CONVERT(VARCHAR(24),personnel.reg_job,105)) as monthStartJob
from member,personnel
where member.id_card=personnel.id_card
and personnel.personnel_id = '5500987'
select personnel.personnel_id, personnel.reg_job, member.vacation_max
,DATEDIFF(yyyy , dateadd(year, 543 ,GETDATE()) ,personnel.reg_job) as years
,DATEDIFF(yyyy , year(2554-01-02) , ( year(GETDATE())+'543') ) as years1
,month(CONVERT(VARCHAR(24),personnel.reg_job,105)) as monthStartJob
from member,personnel
where member.id_card=personnel.id_card
and personnel.personnel_id = '5500987'
select personnel.personnel_id, personnel.reg_job, member.vacation_max
,DATEDIFF(yyyy , personnel.reg_job , dateadd(year, 543 ,GETDATE()) ) as years
,DATEDIFF(yyyy , year(2554-01-02) , ( year(GETDATE())+'543') ) as years1
,month(CONVERT(VARCHAR(24),personnel.reg_job,105)) as monthStartJob
from member,personnel
where member.id_card=personnel.id_card
and personnel.personnel_id = '5500987'