title: how to use distinct in ms access
body: <p>I have two tables. Task and Categories. </p>
  
  <p><img src="https://i.stack.imgur.com/bkwUI.jpg" alt="Task Table"></p>
  
  <p><img src="https://i.stack.imgur.com/7Oo2z.jpg" alt="Categories Table"></p>
  
  <p>TaskID is not a primary key as there are duplicate values.When there are multiple contacts are selected for a specific task,taskid and other details will be duplicated.I wrote the query:</p>
  
  <pre><code>SELECT Priority, Subject, Status, DueDate, Completed, Category
  FROM Task, Categories
  WHERE Categories.CategoryID=Task.CategoryID;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/IQ2go.jpg" alt="Query Result"></p>
  
  <p>Now as multiple contacts are selected for that task,for the taskid=T4, there are two records(highlighted with gray). I have tried using distinct in ms access 2003 but its not working. I want to display distinct records. (Here there's no requirement to show taskid) If I write :</p>
  
  <pre><code>select priority, distinct(subject), .......
  </code></pre>
  
  <p>and remaining same as mentioned in above query then its giving me an error. I have tried distinctrow also.But didnt get success. How to get distinct values in ms access?</p>