Results 1 to 16 of 16

Thread: Trouble with Group by

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2016
    Posts
    834

    Trouble with Group by

    Hello
    Code:
    "Select affiche, Count(num)as num from Table1 where num = " & Text1.Text & " GROUP BY affiche", DB, adOpenStatic, adLockOptimistic
    
     MsgBox RSS.RecordCount
    The msgbox is returning false results.
    In the database I can see only one item in the affiche field but the msgbox is returning 2 items.
    The same thing with distinct funcction
    Code:
    "Select distinct affiche  from Table1 where num = " & Text1.Text & " ", DB, adOpenStatic, adLockOptimistic
    Then I used DISTINCTROW function
    Code:
    "Select DISTINCTROW affiche  from Table1 where num = " & Text1.Text & " ", DB, adOpenStatic, adLockOptimistic
    the mesagebox returns 3

    Attachment 135733
    Last edited by Mustaphi; Mar 1st, 2016 at 04:43 PM.

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