Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Including SubQueries to reports Post Reply Post New Topic
Author Message
NewJack
Newbie
Newbie


Joined: 24 Nov 2009
Location: United States
Online Status: Offline
Posts: 6
Quote NewJack Replybullet Topic: Including SubQueries to reports
    Posted: 24 Nov 2009 at 5:07pm
I wrote and SQL query with a sub query.  How do I include this sub query when I am creating a  report using version XI?
 
Here is the query:
 
SELECT   Table 1 . item_no ,
         Table 1 . item_desc ,
         Table 2 . location ,
         Table 2 . qty ,
         Table 3 . price ,
         Table 3 . period ,
         Table 1 . sold 
       
FROM   ( B003C5EA . Database . Table 2   Table 2
 INNER JOIN  Database1.Table 1   Table 1  ON   Table 2.item_no  = Table 1.intem_no )
 INNER JOIN  Database1.Table 3   Table 3  ON ( Table 2.item_no  = Table 3.item_no)
                                         AND ( Table 2.location = Table 3.location )
WHERE   Table 1 .Type ='STK' AND
               Table 1 .item_no  not in (select   Table 4 . item_no 
                                                       from  Database1.Table 4
                                                       where   Table 4 . loction  = '999
') and
         Table 3.period  between '200900' AND '200910'
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Nov 2009 at 6:09pm
If you make a SQL view or Stored PRoc from this then just use the view or SP as your source. IF you want to use a COmmand you can use your SQL there.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.