How to Get Sql sever 2000 WeekFirstDay and WeekLastDay...
Public Function GetWeekFirstDay() As String
'Last week day set by Sunday
'Sunday is week first day -1
'Monday is week first day 0
'......1,2,3,4
Dim sql As String
sql = "SELECT convert(varchar(10),DATEADD(wk, DATEDIFF(wk,0,getdate()), -1),121) as WeekFirstDay "
Dim ds As DataSet = iobj_sql.GetRowsByQuery(sql)
Return ds.Tables(0).Rows(0).Item("WeekFirstDay")
End Function
Public Function GetWeekLastDay()
'Last week day set by Saturday
Dim sql As String
sql = "SELECT convert(varchar(10),DATEADD(wk, DATEDIFF(wk,0,getdate()), -1)+6,121) as WeekFirstDay "
Dim ds As DataSet = iobj_sql.GetRowsByQuery(sql)
Return ds.Tables(0).Rows(0).Item("WeekFirstDay")
End Function