- Joined
- 31 Dec 2003
- Posts
- 5,172
- Location
- Barrow-In-Furness
Thanks.
I've tested the query and it's working. Can't get anything to display now i've also added the UserName parameter though.
I really need to start thinking how I can get data to display like I said in the original post though...
SQL Query
I've tested the query and it's working. Can't get anything to display now i've also added the UserName parameter though.
Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim inDate As DateTime
Dim WeekNumber As Integer
Dim UserName As String
inDate = Date.Today.Date
WeekNumber = Weeknumber_Entire4DayWeekRule(inDate)
UserName = Me.User.Identity.Name
Dim hoursAdapter As New ManHoursTableAdapters.tblHoursTableAdapter()
Dim weeksHours As ManHours.tblHoursDataTable = hoursAdapter.GetWeekly(WeekNumber, UserName)
GridView1.DataSource = weeksHours
GridView1.DataBind()
End Sub
I really need to start thinking how I can get data to display like I said in the original post though...
SQL Query
Code:
SELECT tblHours.*
FROM tblHours
WHERE DATEPART (dw, Date) is not null AND DATEPART (wk, Date) = @WeekNo
AND UserName = @UserName