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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making a list from two colums in the same table

Status
Not open for further replies.

mildoo

MIS
Joined
Oct 8, 2004
Messages
7
Location
GB
Crystal Reports: I am trying to make a list from two fields in the same table. Ant ideas?
 
Can we get a bit more detail like CR version, database ??


Are you trying to concatenate 2 fields and show as one in the report then you need to create a formula field set to

{field1} + {field2}

Or if its coming from a database query concatenate the fields in the query.
 
Crystal reports 10
Oracle9i database

What I want to do is create a list from two fields(number) in the same table listing all entries in the first field followed by all entries in the seond field eg.

Field 1 Field 2
1 4
2 5
3 6

Result
1
2
3
4
5
6
 
Don't know anything about Oracle but the pseudo sql code would be

Select Field1 From Tablename
UNION
SELECT Field2 from Tablename

not sure there is an easy way of doing this within Crystal Reports
 
In Crystal 8.5, what I'd do is to have a subreport in the report footer for the second field. It would appear to be all one report.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
UNION is indeed the best approach. Just be sure to use UNION ALL (much faster than UNION) if you don't need to remove duplicates.

In Crystal 9 you can simply use a Command as a data source.
In Cr 8.5 you can use a Crystal SQL Designer query as a data source. A simpler approach, regardless of the Crystal version, is to create a View or Stored Procedure in Oracle and use it as the data source.

hth,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top