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!

I Need Multiple Records on the Same Detail Line - Any Clues? 1

Status
Not open for further replies.

dcrosier

Instructor
Mar 17, 2000
51
US
My End User wants a report that will show him the Work Centers that are late. No problem. I created a query to extract the information and indicate whether the Work Center was late or not.

My Data is as follows:
Code:
Job #	   Work_Center	Act. Start  Sched Start
10302	   PURCHAS	     6/3/01	   2/1/01
10974-13    CUTTING	     5/16/01	  5/4/01
10974-13    FACTORY	     6/8/01	   5/17/01
10974-14    CUTTING	     5/29/01	  5/18/01
10974-14    FACTORY	     6/9/41	   6/1/01

My Problem is that the User wants to see the data lined up as:
-----------------
Code:
Job      Purch        Cutting       Factory
         Act. Start   Act. Start    Act. Start
         Sched Start  Sched Start   Sched Start
10302      6/3/01
10974-13               5/16/01       6/8/01
                       5/4/01        5/18/01
-----------------

I grouped on the Job field.
Then I copied each of the Start Date Fields and applied Suppress Formatting with the Following Formula:
Code:
if {Work_Center}<>&quot;CUTTING&quot; then
      True //Suppress the Date
   Else
      False //Do Not Suppress the Date

Which Works EXCEPT that on each change of the Work Center the detail line staggers down the report.

Any suggestions? Of course, the report is now late because I am spinning my wheels on getting this figured out.

Thanks.
Dawn

 
If I understand correctly, you may want to add additional detail sections and then in format section, select 'Underlay Following Sections' for the appropriate detail lines. You can also do this with the Group Header so that all appears on 1 line.
 
Well, I have tried setting up both multiple Detail sections with underlaying the following section, and multiple group sections with the same result.

My Data still ends up staggering down the report.

Any other suggestions?

Dawn

Code:
		       Purchasing	 Cutting		Factory
Job Number	 Sched Start	Sched Start     Sched Start
		      Actual Start    Actual Start	Actual Start
10302      	6/3/01
		      6/6/01
10974-13               		5/16/01       
                       		5/4/01        
						                        6/8/01
						                        5/18/01
 
I had the same problem. I tried the Underlay suggestion, but I still got staggered detail lines.
 
I assume youre working in Access or you probably would have used a stored procedure already. A stored procedure is a saved query. When you're getting the data source for your report, and you're in the ODBC area, click OPTIONS and make sure &quot;stored procedures&quot; is checked. This will allow you to see queries too. Since you can't make a query like the one below using the GUI interface of the Query Design screen, while in the Query Designer you'll need to go to View, choose SQL, and paste the above SQL. I semi-tested this in Access 2000 and it worked, so if you change the table and column names you shouldn't have any(or many) syntax errors.


Select &quot;Actual&quot; as StartType, P.Job#, P.ActStart as PurchStart,
Select C.ActStart From TableName C where Job# = P.Job# AND WorkCenter = &quot;Cutting&quot;) as CutStart,
(Select F.ActStart From TableName F where Job# = P.Job# AND WorkCenter = &quot;Factory&quot;) as FactStart
From TableName P
Where WorkCenter = &quot;Purchasing&quot;

UNION

Select &quot;Scheduled&quot; as StartType, P.Job#, P.SchedStart as PurchStart,
Select C.SchedStart From TableName C where Job# = P.Job# AND WorkCenter = &quot;Cutting&quot;) as CutStart,
(Select F.SchedStart From TableName F where Job# = P.Job# AND WorkCenter = &quot;Factory&quot;) as FactStart
From TableName P
Where WorkCenter = &quot;Purchasing&quot;;


This will make your recordset look like:
StartType Job# PurchStart CutStart FactStart
Actual 10974-13 5/16/01 6/8/01
Scheduled 5/4/01 5/18/01


If this is undesireable for some reason, you could accomplish the same thing within Crystal by using three subreports instead of fields. Use selection criteria to make sure each subreport shows the desired date.

Or change the table design to fit your needs.

Hope this does it for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top