Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    5

    Unanswered: Limit SQl Statement To Return Unique Records Only

    Limit SQl Statement To Return Unique Records Only

    Im transforming a stand alone mail script to run of our main user database and I have the unique problem of my SQL Statement sending everyone as many emails as there are users.

    The SQL is inside a loop like this to cycle trough all the user and send out emails to each.

    Do While Not RS.eof

    SQL = "SELECT * FROM Users WHERE subNewsletter=True AND Newsletter_Name='Test'"

    RS.movenext
    Loop

    Is there a way to force the SQL Statement to return unique hits only maybe using each users ID #?

  2. #2
    Join Date
    Dec 2003
    Posts
    18

    Re: Limit SQl Statement To Return Unique Records Only

    Hi there,

    This is just a thought...I'm not an expert. Check out the use of DISTINCT in SQL statements. An example would be:

    SELECT DISTINCT Field1, Field2, Field3 FROM YourTableName

    You can add WHERE criteria to this if you need to.

    Hope this helps.

    Amadea

Posting Permissions

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