Help! I've got three tables -

resources (resource_id, description, total_available)
resources allocated: (allocation_id, resource_id, event_id)
and events with event_id and event_date

My output for each event has to show:
All resource names, and the total number of each resource booked on that
date

So far the closest I've got is

<cfquery name="GetRecord" datasource="#variables.database#">
SELECT DISTINCT SUM(Resource_Allocation.Resource_Id)AS
Booked,Resources.Total_Available, Resources.Description, Events.Event_Date
FROM   Events,Resources,Resource_Allocation             
WHERE  Resource_Allocation.Resource_Id = Resources.Resource_Id

AND    Resource_Allocation.Event_Id = Events.Event_Id
AND    Events.Event_Date = #variables.EventDate#
GROUP BY  Resources.Description, Resources.Total_Available,Events.Event_Date
</cfquery> 

But this only shows the resources booked for that day, not the whole list
of resources

I'm grateful if anyone can help

Crispin Ryan

______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
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