Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Tricky Query

Author  Topic 

robc
Yak Posting Veteran

60 Posts

Posted - 2006-05-09 : 17:58:08
Well it's seeming very tricky to me atm, but i'm positive i'm overlooking something.

Im trying to display the comics for a particular show based on
this "where" clause; "where shows.showdate <= '05/11/2006'"

There is sufficient data in each table to make it work but i can't seem to get it.

so far i have

SELECT nameFirst,nameLast,photo,blurb,bio,website,status FROM Shows
INNER JOIN Shows ON
ComicShows.showid = Shows.showID
INNER JOIN Comics ON
ComicShows.comicid = Comics.comicid
WHERE showdate >= '05/11/2006'
ORDER BY showdate ASC


any help would be greatly appreciated. Cheers

Rob C



MichaelP
Jedi Yak

2489 Posts

Posted - 2006-05-09 : 18:08:50
That first join is killing you methinks


SELECT nameFirst,nameLast,photo,blurb,bio,website,status
FROM Shows
INNER JOIN ComicShows ON ComicShows.showid = Shows.showID
INNER JOIN Comics ON ComicShows.comicid = Comics.comicid
WHERE Shows.showdate >= '05/11/2006'
ORDER BY Shows.showdate ASC


Michael


<Yoda>Use the Search page you must. Find the answer you will. Cursors, path to the Dark Side they are. Avoid them, you must. Use Order By NewID() to get a random record you will.</Yoda>

Opinions expressed in this post are not necessarily those of TeleVox Software, inc. All information is provided "AS IS" with no warranties and confers no rights.
Go to Top of Page

robc
Yak Posting Veteran

60 Posts

Posted - 2006-05-09 : 18:23:33
lol thank you! i'm going to crawl into a corner now.

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-05-10 : 04:18:50
Also instead of '05/11/2006' use '20060511' to work with servers with different date settings

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -