Cutter (CF-Talk) wrote:
> I've got two tables, tblDates and tblEnt. tblEnt uses the intDateID
> field of tblDates. I am trying to pull the next 7 days where there is
> entertainment scheduled. tblEnt has a row for each day, but each day
> does not necessarily have entertainment. How can I go about this? It's
> easy when everyday has entertainment, but when there are one or two
> "dark" days it get's confusing. Any help is greatly appreciated.

It sounds like you want to use some sort of Outer Join.  You code will
likely look something like:

SELECT
tblDates.intDateID,
tblDates.foo,
tblEnt.bar
...
FROM
tblDates LEFT JOIN tblEnt
ON tblDates.intDateID = tblEnt.intDateID
WHERE
-- code to get next 7 days ---

The Left (Outer) Join retrieves all records from the table on the left of
the _expression_ and only the matching rows from the table on the right of the
_expression_.

HTH

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to