I need your help! (SQL)

Results 1 to 2 of 2

Thread: I need your help! (SQL)

  1. #1
    Join Date
    Dec 1969

    Default I need your help! (SQL)

    I need to do the following:<BR>Count each name that occurs in a table and display it only once in alpha order and display how many occurences there are of that person in the table<BR>ie.<BR>Jane Doe 5<BR>Kim Smith 1<BR>Mary Johnson 8<BR>SQL = "SELECT Count(Name) FROM Customers GROUP By Name"<BR>SQL = SQL & " ORDER BY Name"<BR>The problem is that I need to have this dynamically generated by a drop down date selected by the user so that they can have this info for a given day and I am having trouble incorporating the<BR>WHERE DateX = &#039;"&ReportDate&"&#039;<BR>When I try SELECT Count(Name), DateX etc... I get an error because of the DateX not being part of an aggregate function.<BR>Can someone help me piece this together? Please :)<BR>Thank you!

  2. #2
    Join Date
    Dec 1969

    Default RE: I need your help! (SQL)

    stick the date bit as part of the order bit<BR>hence it will be part of the aggregate function

Posting Permissions

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