且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在asp.net中获取特定日期的星期几

更新时间:2023-01-28 21:17:38

选择日期名称(dw,''25nov2011'')
select datename(dw,''25nov2011'')


在查询中可以使用datename()方法

In query you can use datename() method

string selectSQL = "select UPPER(name) as name,userid,day(dob) as da,DATENAME(month,dob) as mn,Designation,Deptt from empbirth where day (dob-1)= datepart(day, getdate()) AND month(dob)= datepart(month, getdate()) or day (dob-2)= datepart(day, getdate()) AND month(dob)= datepart(month, getdate())";