CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Threaded View

  1. #2
    Join Date
    Oct 2008
    Location
    Richmond, VA
    Posts
    24

    Re: Problem in using Sum in SQL

    One problem I notice is your where statement for the second SUM():

    where A= 'George' and A ='Kevin'

    this will always be 0, because 'George' does not = 'Kevin'
    you are probably looking for:

    where A= 'George' OR A ='Kevin'





    Also, I am not sure exactly what the data contains and also not sure what you are trying to find with your query, but I doubt you would need:

    GROUP BY B,C,D,E

    my guess is that GROUP BY B would probably do the trick.




    Please post what errors you are getting from your query (if any).

    Also, an explaination of what the table contains and what you are trying to get with your query may help as well.
    Last edited by Nightwolf629; October 23rd, 2008 at 08:18 AM. Reason: edit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured