同上!
解决方案 »
- asp.net 生成伪静态后如何获取地址栏中的静态url
- 动态加载的控件取值问题
- 在CS中使用ASP.NET假冒的問題.
- 多次操作数据库的同一性问题?
- 自定义HTML页面的问题?答者有分!严禁灌水!
- 客户端 offsetLeft offsetHeight offsetTop clientWidth offsetWidth 等属性的区别
- 怎么样带着文件走
- 请问如何处理新闻系统中的图片显示问题?
- asp.net使用FlashPrinter 生成SWF文件问题
- 请教Session 会在 blank 的弹出页面中失效的问题。
- 各位高手们求救啊,请问这是什么错误呢?
- ASP.NET精品全站程序SQL版一例,那位达人研究过,给小弟讲解一下?
declare @m int
set @m=2 --月份
select datediff(day,'2003-'+cast(@m as varchar)+'-15' ,'2003-'+cast(@m+1 as varchar)+'-15')
另外,取得本月天数
select datediff(day,cast(month(GetDate()) as varchar)+'-'+cast(month(GetDate()) as varchar)+'-15' ,cast(month(GetDate()) as varchar)+'-'+cast(month(GetDate())+1 as varchar)+'-15')
或者使用计算本月的最后一天的脚本,然后用DAY函数区最后一天
SELECT Day(dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate())+1, 0)))
DateTime.DaysInMonth(年,月)
比如求取2005年3月份共有多少天,即如下:
DateTime.DaysInMonth(2005,3)
DateTime.DaysInMonth(dt.Year,dt.Month);
int days=DateTime.DaysInMonth(2004,7);