SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Number weeks of work
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cms9651
Starting Member

28 Posts

Posted - 12/23/2012 :  06:32:28  Show Profile  Reply with Quote
Number weeks of work

Hi there.

I should check that the the number weeks of work for the five names is the same for all... that is, there can not be a person who works more or less of other...

I create a table `tbl_dates` where the primary key is the date and another field used for the holiday.

How do distribute equally these five names for the working weeks in the year?

Can you help me? Any suggestions?
thank you in advance
-- ----------------------------
-- Table structure for [dbo].[tbl_dates]
-- ----------------------------
DROP TABLE [dbo].[tbl_dates]
GO
CREATE TABLE [dbo].[tbl_dates] (
[Dates] date NOT NULL ,
[Holidays] date NULL ,
[DayDates] varchar(20) NULL ,
[DayHolidays] varchar(20) NULL 
)


GO

-- ----------------------------
-- Records of tbl_dates
-- ----------------------------
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-02', N'2013-01-01', N'mercoledì', N'martedì');
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-03', N'2013-04-01', N'giovedì', N'lunedì');
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-04', N'2013-04-25', N'venerdì', N'giovedì');
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-07', N'2013-05-01', N'lunedì', N'mercoledì');
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-08', N'2013-08-15', N'martedì', N'giovedì');
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-09', N'2013-11-01', N'mercoledì', N'venerdì');
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-10', N'2013-12-25', N'giovedì', N'mercoledì');
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-11', N'2013-12-26', N'venerdì', N'giovedì');
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-14', N'2013-12-31', N'lunedì', N'martedì');
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-15', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-16', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-17', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-18', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-21', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-22', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-23', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-24', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-25', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-28', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-29', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-30', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-01-31', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-01', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-04', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-05', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-06', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-07', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-08', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-11', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-12', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-13', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-14', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-15', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-18', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-19', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-20', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-21', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-22', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-25', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-26', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-27', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-02-28', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-01', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-04', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-05', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-06', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-07', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-08', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-11', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-12', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-13', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-14', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-15', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-18', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-19', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-20', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-21', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-22', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-25', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-26', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-27', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-28', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-03-29', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-02', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-03', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-04', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-05', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-08', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-09', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-10', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-11', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-12', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-15', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-16', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-17', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-18', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-19', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-22', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-23', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-24', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-26', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-29', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-04-30', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-02', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-03', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-06', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-07', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-08', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-09', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-10', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-13', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-14', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-15', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-16', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-17', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-20', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-21', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-22', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-23', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-24', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-27', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-28', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-29', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-30', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-05-31', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-03', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-04', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-05', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-06', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-07', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-10', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-11', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-12', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-13', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-14', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-17', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-18', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-19', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-20', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-21', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-24', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-25', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-26', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-27', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-06-28', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-01', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-02', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-03', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-04', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-05', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-08', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-09', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-10', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-11', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-12', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-15', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-16', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-17', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-18', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-19', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-22', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-23', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-24', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-25', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-26', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-29', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-30', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-07-31', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-01', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-02', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-05', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-06', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-07', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-08', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-09', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-12', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-13', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-14', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-16', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-19', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-20', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-21', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-22', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-23', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-26', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-27', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-28', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-29', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-08-30', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-02', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-03', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-04', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-05', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-06', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-09', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-10', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-11', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-12', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-13', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-16', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-17', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-18', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-19', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-20', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-23', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-24', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-25', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-26', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-27', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-09-30', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-01', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-02', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-03', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-04', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-07', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-08', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-09', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-10', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-11', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-14', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-15', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-16', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-17', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-18', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-21', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-22', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-23', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-24', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-25', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-28', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-29', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-30', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-10-31', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-04', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-05', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-06', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-07', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-08', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-11', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-12', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-13', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-14', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-15', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-18', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-19', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-20', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-21', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-22', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-25', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-26', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-27', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-28', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-11-29', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-02', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-03', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-04', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-05', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-06', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-09', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-10', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-11', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-12', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-13', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-16', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-17', null, N'martedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-18', null, N'mercoledì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-19', null, N'giovedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-20', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-23', null, N'lunedì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-27', null, N'venerdì', null);
GO
INSERT INTO [dbo].[tbl_dates] ([Dates], [Holidays], [DayDates], [DayHolidays]) VALUES (N'2013-12-30', null, N'lunedì', null);
GO

-- ----------------------------
-- Indexes structure for table tbl_dates
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table [dbo].[tbl_dates]
-- ----------------------------
ALTER TABLE [dbo].[tbl_dates] ADD PRIMARY KEY ([Dates])
GO




-- ----------------------------
-- Table structure for [dbo].[tbl_names]
-- ----------------------------
DROP TABLE [dbo].[tbl_names]
GO
CREATE TABLE [dbo].[tbl_names] (
[names] varchar(50) NULL ,
[id] int NOT NULL IDENTITY(1,1)
)


GO
DBCC CHECKIDENT(N'[dbo].[tbl_names]', RESEED, 5)
GO

-- ----------------------------
-- Records of tbl_names
-- ----------------------------
SET IDENTITY_INSERT [dbo].[tbl_names] ON
GO
INSERT INTO [dbo].[tbl_names] ([names], [id]) VALUES (N'George', N'1');
GO
INSERT INTO [dbo].[tbl_names] ([names], [id]) VALUES (N'Laura', N'2');
GO
INSERT INTO [dbo].[tbl_names] ([names], [id]) VALUES (N'Martin', N'3');
GO
INSERT INTO [dbo].[tbl_names] ([names], [id]) VALUES (N'Arnold', N'4');
GO
INSERT INTO [dbo].[tbl_names] ([names], [id]) VALUES (N'Betty', N'5');
GO
SET IDENTITY_INSERT [dbo].[tbl_names] OFF
GO

-- ----------------------------
-- Indexes structure for table tbl_names
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table [dbo].[tbl_names]
-- ----------------------------
ALTER TABLE [dbo].[tbl_names] ADD PRIMARY KEY ([id])
GO

khtan
In (Som, Ni, Yak)

Singapore
17650 Posts

Posted - 12/23/2012 :  20:11:59  Show Profile  Reply with Quote
can you explain your schema ?

what five names are you referring to ?

what is your expected result ?


KH
Time is always against us

Go to Top of Page

cms9651
Starting Member

28 Posts

Posted - 12/24/2012 :  08:40:57  Show Profile  Reply with Quote
thank you for reply.

one of five people in the [tbl_names] have to work a full week [tbl_dates], while others are off.
everyone has to work the same number of weeks for year.

know what I mean?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 12/24/2012 :  15:36:15  Show Profile  Reply with Quote
so whats your expected output?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000