SELECT DISTINCT(CMME.iMonthlyEventID)

:)

Kevin


-----Original Message-----
From: Amanda Stern [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 09, 2002 9:18 AM
To: CF-Talk
Subject: SQL help - getting first rec of field????

Hello,

I have been trying to figure out how to write this SQL
stmt..I have it written but it needs one more
modification....I need the query to only pull the
first unique EventID...

SELECT  CMME.iMonthlyEventId as EventID, 
        CMME.iCMApptId as CMapptID, 
        cli.vClientFName + cli.vClientLName as  
                          ClientName,
        CMME.dMonthlyEventDate as Event Date, 
        cas.iCasacApptID as CasacID,
        cas.dCasacDate as CasacDate,
        emp.vEmpFName + emp.vEmpLNAme as Case_Manager,
        cd1.vcodedecode as eventtypeName
FROM    CMMonthlyEvent CMME,  codedecode cd1, 
        Client cli, employee emp, CasacAppt cas,  
        CasacApptRelationship rel
WHERE      emp.iempId = CMME.iempId
AND        cas.iClientID  =  cli.iClientID
AND        cd1.icodedecodeId = CMME.cEventTypeId
AND        CMME.iCMApptId = rel.iCMApptId
AND        cas.iCasacApptID = rel.icasacapptid
order by   CMME.iCMApptId, dmonthlyeventdate

the partial results are:

EventID   CMapptID .......
  60        1
  60        1  
  75        1
  75        1
  80        3
  80        3
  80        3 

I want the results to be..
  60        1
  75        1 
  80        3



 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to