>- see footer for list info -<
<cfoutput query="getIncidents" group="IncidentDate">
#getIncidents.IncidentDate#<br>
<cfoutput>
#getIncidents.VictimName#<br>
</cfoutput>
<br>
</cfoutput>

Duncan Cumming
New Media Developer
Customer Relations Management / Education
Fife Council
700 4105 / 01592 414105

>>> [EMAIL PROTECTED] 27/04/2006 09:53:02 >>>
>- 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 -<


**********************************************************************
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed and 
should not be disclosed to any other party. 
If you have received this email in error please notify your system manager and 
the sender of this message.

This email message has been swept for the presence of computer viruses but no 
guarantee is given that this e-mail message and any attachments are free from 
viruses.

Fife Council
Tel: 08451 55 00 00
************************************************

_______________________________________________

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