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]
- Re: OT: SQL question Alex
- RE: OT: SQL question Alistair Davidson
- OT: SQL Question Tony Carcieri
- RE: SQL Question Rob Rohan
- Re: OT: SQL Question Jochem van Dieten
- RE: OT: SQL Question Tony Carcieri
- CF & Currency Conversion Srimanta
- OT: SQL Question Jeff Chastain
- Re: OT: SQL Question Stephen Hait
- OT: SQL Question Cutter (CF-Talk)
- ot: sql question Mosh Teitelbaum
- ot: sql question Tony Weeg
- RE: sql question Tony Weeg
- Re: ot: sql question Jochem van Dieten
- RE: ot: sql question Tony Weeg
- ot: sql question Tony Weeg
- RE: sql question Paul Vernon
- RE: sql question Tony Weeg
- RE: sql question Andy Ousterhout
- ot: sql question Tony Weeg
- Re: sql question Paul Hastings