Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distinct Order By

Status
Not open for further replies.

johnrowse

Technical User
Aug 7, 2013
14
GB
Hi

I know i must be missing something obvious, but i have been trying to get the following to work. Below is my ideal, but i understand it doesn't work like this. If i add dLastVisited to my distinct statement, no longer will i only return lSamplePointIDs. Can anyone let me know where i am going wrong?

SQL:
SELECT Distinct tblPumpPointDownload.lSamplePointID
FROM tblPumpPointDownload
inner join 
tblSamplePointDownload ON tblPumpPointDownload.lSamplePointID = tblSamplePointDownload.lSamplePointID
WHERE(tblSamplePointDownload.lSiteID = @lSiteID)
GROUP BY dLastVisited ,lSamplePointID,lpumppointid
order by dLastVisited


Thanks

John
 
You may get better rersults here: forum183

Beir bua agus beannacht!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top