如何使用sql中的条件动态创建一个月的天数 [英] How to create days Dynamically for a month with the conditions in sql
问题描述
CREATE TABLE employee_active_on_proj
(
EmpName varchar ( 50 ),
ProjectName varchar ( 50 ),
startofproject datetime ,
EndOfProject < span class =code-keyword> datetime
);
这里有一行数据
插入 进入 employee_active_on_proj 值(' JOhn',' Projet 1',' 03/04/2015',' 2015年4月14日')
insert into employee_active_on_proj 值(' JOhn', ' Projet 2',' 16 / 04/2015',' 24/04/2015')
我的输出应该基于输入使用存储过程的月份和年份
==================================== ===================================
Empname 01/04/2015。 .03 / 04/2015 14/04/2014 .... 31/04/2015
============== ================================================== =======
JOhn N / A ACTIVE项目结束
============ ================================ ============================
这个怎么样?
在SQL Server中生成日期表 [ ^ ]
CREATE TABLE employee_active_on_proj
(
EmpName varchar(50),
ProjectName varchar(50),
startofproject datetime,
EndOfProject datetime
);
And here is one row of data
insert into employee_active_on_proj values('JOhn','Projet 1','03/04/2015','14/04/2015')
insert into employee_active_on_proj values('JOhn','Projet 2','16/04/2015','24/04/2015')
My output should be based on the inputs Month and year using stored procedure
=======================================================================
Empname 01/04/2015 .. 03/04/2015 14/04/2014 .... 31/04/2015
=======================================================================
JOhn N/A ACTIVE Project ends
========================================================================
How about this?
Generate Date Table in SQL Server[^]
这篇关于如何使用sql中的条件动态创建一个月的天数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!