日期:2014-05-17 浏览次数:20692 次
-----年假年度数表
CREATE TABLE [dbo].[AV](
    [employeeid] [int] NULL,
    [yearmonth] [datetime] NULL,
    [Havenumber] [int] NULL,
    [Overnumber] [int] NULL,
    [Oddnumber] [int] NULL,
    [sta] [nchar](10) NULL
) ON [PRIMARY]
-----年假调休表
CREATE TABLE [dbo].[AVDetail](
    [Id] [int] NOT NULL,
    [Employeeid] [int] NULL,
    [XJDate] [datetime] NULL,
    [XJnumber] [int] NULL
) ON [PRIMARY]
----插入年假总数据表  AV年假总数
insert into av
select 1,'2011-01-01',20,0,20,null
union
select 1,'2012-01-01',10,0,10,null
union 
select 3,'2011-01-01',20,0,20,null
union
select 3,'2012-01-01',10,0,10,null
insert into dbo.AVDetail
select 1,1,'2011-12-02',4
union 
select 2,1,'2011-12-03',4
union 
select 3,1,'2011-12-05',8
union 
select 4,1,'2011-12-08',8
union 
select 5,1,'2011-12-08',8
union 
select 6,3,'2011-12-08',8
union
select 7,3,'2011-12-05',8
union 
select 8,3,'2011-12-08',8
union 
select 9,3,'2011-12-08',8
union 
select 10,3,'2011-12-08',8