Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query issues....

Status
Not open for further replies.

BigFizil

MIS
Mar 9, 2003
23
US
I used a query in VB with an access form as the front end to create a report...I have modified it to try to make it work in SQL Server...it is returning too many fields though currently.....

Select dev.KinderNumber,dev.Client,dev.MFG,dev.FAMILY,dev.Intro_Date,dev.FIXTURE,dev.Dimensions_HWD,
dev.MFG_Price,dev.Item_Number,dp.picname from Development
as dev, DevelopmentPictures as dp
RIGHT JOIN Development ON dp.[KinderNum] = Development.[KinderNumber]
WHERE dp.[Revision_Letter]
IN(select max([Revision_Letter]) from DevelopmentPictures where DevelopmentPictures.KinderNum = dp.KinderNum);

this returns about 57000 rows I usually have about 350-400..

also : IN(select max([Revision_Letter]) from DevelopmentPictures where DevelopmentPictures.KinderNum = KinderNum);

if I take out the dp from dp.kindernum it only retunrs the row headings??

Please help!

thanks in advance,

John
 
Code:
Select dev.KinderNumber,
       dev.Client,
       dev.MFG,
       dev.FAMILY,
       dev.Intro_Date,
       dev.FIXTURE,
       dev.Dimensions_HWD,
       dev.MFG_Price,
       dev.Item_Number,
       dp.picname 
  from Development as dev right join DevelopmentPictures as dp
    ON dp.KinderNum = Dev.KinderNumber
 WHERE dp.Revision_Letter IN
 (select max(Revision_Letter) 
    from DevelopmentPictures 
   where KinderNum = dp.KinderNum)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top