Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6157675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:49:33+00:00 2026-05-23T20:49:33+00:00

I have a legacy database in which data is stored in a way similar

  • 0

I have a legacy database in which data is stored in a way similar to:

id,a1,a2,a3,a4,a5...,a20,b1,b2,b3,b4,...,b20,c1,c2,c3,c4,...,c20

My task is to select top 3 values from the b columns and print corresponding a and c values. So, if the max values are in b5,b1,b17 then I need to print on the report something like this:

a5, b5, c5
a1, b1, c1
a17, b17, c17

I tried using pivot tables and cross tabs, yet with no luck (well, this may be the result of the fact, that I have only basic understanding of Crystal Reports).

May I ask for some tips or guidelines to how can I achieve this?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:49:34+00:00Added an answer on May 23, 2026 at 8:49 pm

    Unfortunately, Crystal Reports doesn’t have an Eval() function, which would certainly help.

    Here’s a hack-ish approach:

    1. create a Detail section for each field set: aX, bX, cX–there will be 20 such sections. So, Details a would contain a1, b1, c1; Details b would contain a2, b2, c2. You get the idea.
    2. determine which b columns contain the maximum values; store these column # in an array, perhaps
    3. hide/show each detail section by comparing its index (letter of the alphabet) to the array of column indicies.

    Another approach is to create a UNION query in the report’s Command:

    SELECT ID, 1 as idx, a1 as A, b1 as B, c1 as C
    
    UNION 
    
    SELECT ID, 2 as idx, a2 as A, b2 as B, c2 as C
    
    ...
    
    UNION
    
    SELECT ID, 20 as idx, a20 as A, b20 as B, c20 as C
    

    Reporting on this approach is trivial.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table which has essentially boolean values in a legacy database. The
I have a legacy database which contains simple data structures (no CODE refs thank
I have two data sources: a legacy one (web service) and a database one.
Because of legacy data which is not available in the database but some external
I have a legacy database with a field which contains some parentheses, like red(b).
I'm building an application on top of a legacy database (which I cannot change).
I have a small database which is legacy from an almost defunct project. This
I have a new rails app which needs to access data from a legacy
I have a legacy mysql database and there's this table which has a few
I have developed a grails/groovy application for a legacy database which has user maintenance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.