Reputation: 0 Apprentice
- Active Members
- Active Posts:
- 91 (0.3 per day)
- 26-July 12
- Profile Views:
- Last Active:
- Today, 06:27 AM
- Dream Kudos:
Posts I've Made
Posted 23 Apr 2013There is no error ,but I'm not getting the right value with Count,and no value at all with SUM,I don't know why?
If I write it inside the query builder like this
SELECT SUM(Present) AS Expr1, SUM(Absent) AS Expr2, SUM(Sickleave) AS Expr3, SUM(Weeklyoff) AS Expr4, SUM(Leave) AS Expr5, SUM(NightShift) AS Expr6, SUM(DayShift) AS Expr7 FROM Attendance WHERE (Firstname = 'firstname') AND (Lastname = 'lastname') GROUP BY Present
It gives me values like this
0 4 0 4 0 25 0 26 0 0 0 0 0 0
But if I use COUNT instead of SUM then the same query gives me this result.
8 8 8 8 8 8 8 26 26 26 26 26 26 26
On the other hand when I use the code in the #1 post I get no value with sum but same value again and again with COUNT.
Posted 12 Apr 2013I think I got my answer
Component btn_cancel = new JButton("Cancel");
I was using obsolete AWT versions.
I should have used
JButton btn_cancel = new JButton("Cancel");
Posted 14 Mar 2013ok *CharlieMay* Thanks
Posted 14 Mar 2013It is Date value from DateTimePicker that is stored in that column AND I have found the solution
Dim str10 As String = "Select COUNT(DayShift) FROM Attendance WHERE AttendanceStatus = 6 AND month(AttendanceDate) = " & Month(DateTimePicker1.Text) & " AND Firstname ='" & Firstname_txt.Text.Trim & "';" con.Open() cmd = New SqlCommand(str10, con) Dim dr8 As SqlDataReader dr8 = cmd.ExecuteReader While dr8.Read Dayshift_txt.Text = dr8(0) End While con.Close()
If someone has a better solution it's always welcome
I just wanted to make count of the current month of day shifts attended ,else the whole column count would have given me the wrong value.
Posted 8 Feb 2013Now I have made an hidden textfield in the edit form and pointing my where clause to that hidden field,now the problem is solved.
- Member Title:
- D.I.C Head
- Age Unknown
- Birthday Unknown
- Click here to e-mail me
chdboy hasn't added any friends yet.