chdboy's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
91 (0.3 per day)
Joined:
26-July 12
Profile Views:
319
Last Active:
User is offline Today, 06:27 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   chdboy has not set their status

Posts I've Made

  1. In Topic: COUNT in an sql querry

    Posted 23 Apr 2013

    There 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.
  2. In Topic: The method addActionListener(SpringSample) is undefined for the type

    Posted 12 Apr 2013

    I 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");
    
  3. In Topic: select statment from datetimepicker

    Posted 14 Mar 2013

    ok *CharlieMay* Thanks :)
  4. In Topic: select statment from datetimepicker

    Posted 14 Mar 2013

    It 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.
  5. In Topic: Problem in UPDATE statement

    Posted 8 Feb 2013

    Now I have made an hidden textfield in the edit form and pointing my where clause to that hidden field,now the problem is solved.

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

chdboy hasn't added any friends yet.

Comments

chdboy has no profile comments yet. Why not say hello?