Simple problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ca102960
    New Member
    • Jun 2008
    • 2

    Simple problem

    Hi All,

    I hope you can help me.

    The next statement works for MySQL but not for ACCESS:

    SELECT db1.[field1], db1.[field2], count(id) as total
    from db1
    group by [field1]

    Why?

    Thanks.
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    [field2] is not included as part of an Aggregate Function, this will work:
    [CODE=vb]
    SELECT db1.[field1], db1.[field2], count(id) as total
    from db1
    group by db.[field1], db.[field2][/CODE]

    Comment

    • ca102960
      New Member
      • Jun 2008
      • 2

      #3
      thanks ADezii !!!!!!!!!!!!

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by ca102960
        thanks ADezii !!!!!!!!!!!!
        You are quite welcome.

        Comment

        Working...