Solved

Crystal Report

Posted on 1998-07-17
6
267 Views
Last Modified: 2010-05-03
hi there,
i'm using crystal report 5.0
i hava a table ....
CUSTOMER      DATE            STATUS
AAA            9/12/97            ORDINARY
AAA            12/12/97      GOLD
XXX            8/8/97            RED
YYY            12/12/97      BLUE
BBB            5/12/97            ORDINARY
CCC            12/12/97      ORDINARY
BBB            6/12/97            GOLD
CCC            12/12/98      GOLD

I need to show on my report only records with gold and ordinary status,
and report on the customers, first column of my report lists all the
customers, no repeating values, second column list the date the customer turned ordinary, and third date the customer turned gold  so for my report i should have something like this:

                ORDINARY      GOLD
CUSTOMER      DATE            DATE
______________________________________

AAA            9/12/97            12/12/97
BBB            5/12/97            6/12/97
CCC            12/12/97         12/12/98


please help, any suggestions will be appreciated. thanks.
0
Comment
Question by:mallow
  • 4
  • 2
6 Comments
 
LVL 2

Expert Comment

by:percosolator
ID: 1466117
The problem that you are encountering is that you have a table with linear data, but wish to view it 2-dimensionally.

Mucked-about with a cross-tab report for a while... That's not your solution as to it deals with summary information.

What you need to do is transform your data from the one-dimensional view that it's currently in, to a 2d one.  This can be done with a series of queries to which you link your report.

If you would like, I can send you SQL code for a SQL stored procedure, or the Access queries to do this transformation.  Or Post it, if you'd prefer.

0
 

Author Comment

by:mallow
ID: 1466118
can you please send the codes for the stored procedure to carol@the.net.ph please? thanks :)
0
 
LVL 2

Accepted Solution

by:
percosolator earned 100 total points
ID: 1466119
This script will create SP_TEST when run through I/SQL

Make sure that Crystal can view stored procedures.  Go to File, Options,   SQL tab and there is a check box for stored procedures in a frame called "Allow reporting on"

I am running Crystal 6.0, but 5.0 should have the setting in the same spot.

------------------------------------------

CREATE PROCEDURE SP_TEST AS


      SELECT
            CUSTOMER,
            DATE_                              ORDINARYDATE,
            CONVERT(DATETIME, NULL)            GOLDDATE
      INTO
            #temp
      FROM
            _CUSTOMER
      WHERE
            STATUS = "ORDINARY"


      UPDATE
            #temp
      SET
            GOLDDATE = DATE_
      FROM
            _CUSTOMER
      WHERE
            #temp.CUSTOMER = _CUSTOMER.CUSTOMER
      AND
            _CUSTOMER.STATUS = "GOLD"


      SELECT * FROM #Temp

GO
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:percosolator
ID: 1466120
You never said whether that worked for you, or not.

How'd it go?
0
 

Author Comment

by:mallow
ID: 1466121
hi there percosolator, i have to try the codes, and is this the correct syntax for stored procedure in  informix because i'm getting a syntax error for my stored procedures, if you know that syntax, please tell me, i have to try these codes on monday, thanks :) i'll tell you.
0
 
LVL 2

Expert Comment

by:percosolator
ID: 1466122
ooh.

sorry.  i thought that you were using Microsoft SQL Server.

hmmm.

the syntax is probably close.  i don't know if Informix is ANSI-SQL compiant.  i _think_ that SQL server is....

the syntax might be a little off for Informix, but the logic is sound.

Doug


0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question