Re: join on 3 tables for asp output

From: Mike D (MikeD_at_discussions.microsoft.com)
Date: 10/29/04


Date: Fri, 29 Oct 2004 10:55:04 -0700

What am I missing? Shouldn't this return all rows from Tab_Lookup_Calendar
that are a Monday? Should be more than 11 rows? Could there be somthing
wrong with my SQL server?

SELECT dbo.Tab_Lookup_Calendar.dt, dbo.Tab_Inst_Schedules.Instrument_ID
FROM dbo.Tab_Lookup_Calendar LEFT OUTER JOIN
                      dbo.Tab_Inst_Schedules ON dbo.Tab_Lookup_Calendar.dt =
dbo.Tab_Inst_Schedules.WeekOf
WHERE (dbo.Tab_Lookup_Calendar.isWeekday = 1) AND
(dbo.Tab_Lookup_Calendar.DW = 2) AND
                      (dbo.Tab_Lookup_Calendar.dt <
DATEADD(dbo.Tab_Lookup_Calendar.M, 12, GETDATE())) AND
(dbo.Tab_Inst_Schedules.Instrument_ID = 1)
ORDER BY dbo.Tab_Lookup_Calendar.dt

"Bob Barrows [MVP]" wrote:

> Mike D wrote:
> > I have three tables. The table structure and sample data is
> > below(sorry for the length). I want a select that will retrieve all
> > Mondays since I am scheduling instruments for a whole week. Every
> > Instrument should have a row for every Monday that way I can show
> > that it hasn't been scheduled.
> >
> > Thanks for any help you can provide
> >
> > Mike
> >
> >
> >
> You've done a good job showing us what the data looks like. Now you need to
> show us what the desired results look like. On the face of it, you will need
> some outer joins (I'm assuming this is SQL Server, correct?)
>
> Bob Barrows
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
>



Relevant Pages

  • Re: join on 3 tables for asp output
    ... Mike D wrote: ... The table structure and sample data is ... > Mondays since I am scheduling instruments for a whole week. ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • RE: SQL Server Express on SBS2003 standard
    ... This newsgroup only focuses on SBS technical issues. ... you may want to contact Microsoft CSS directly. ... After you applied the SBS 2003 SP1 successfully, you can install the ... SQL Server Express on SBS. ...
    (microsoft.public.windows.server.sbs)
  • Re: Accessing sql server
    ... port, select All ports, in Remote port, select Fixed port and input 1433 ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ... | I have now checked and I can access the sql server when creating an ODBC ...
    (microsoft.public.windows.server.sbs)
  • Re: Accessing sql server
    ... Filters rule to see if we can resolve this issue. ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ... | I have now checked and I can access the sql server when creating an ODBC ...
    (microsoft.public.windows.server.sbs)
  • RE: Allow access to external SQL server via ODBC thru ISA 2004
    ... Thank you for posting in SBS newsgroup. ... SQL server though SBS with ISA2004. ... To make the client access normally to external ODBC source, ... configure a protocol definition and a access rule on ISA. ...
    (microsoft.public.windows.server.sbs)