- see footer for list info -<
I have an application which is recording bullying incidents in schools.
I have two tables 'Incidents' and 'victim'. For an incident there can be many victims. The incident is stored under date...

I want to be able to return all of the incidents for a given date and show the top 2 victims in a table.

like this

Date          Victims
27/04/06   Bill Blogs
               Bill Gates

28/04/06   Fred Dibnah
               Marge Simpson

etc.....

I am having trouble writing the query ....

SELECT tblIncidents.IncidentDate, tblVictims.VictimName
FROM tblIncidents
INNER JOIN tblVictims ON tblIncidents.IncidentIDPK = tblVictims.IncidentIDFK
WHERE (tblIncidents.IncidentDate = CONVERT(DATETIME, '2006-04-27 00:00:00', 102))

This returns
27/04/06 Bill Bloggs
27/04/06 Fred Dibnah

How do I group the victims under one date?

Regards - Paul


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to