CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual Basic Programming > Crystal Reports
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old March 11th, 2004, 02:26 PM
    sumeetk sumeetk is offline
    Junior Member
     
    Join Date: Mar 2004
    Posts: 1
    sumeetk is an unknown quantity at this point (<10)
    Data Report Problem

    I have a transaction table which contains 2 columns, Amount and Cat_id (category)

    eg my table is like

    Amount | Cat_id
    500 | 1
    300 | 1
    800 | 2
    400 | 2


    So now ive 2 queries
    select amount from transaction where category = 1;

    select amount from transaction where category = 2;

    I want to display the result of these 2 queries in my report.

    If i try to add these queries in two seperate commands in the data environment and then add it to the report then it shows an error.


    So I created 2 views cat1 and cat 2 with those queries, created a new query which takes the value from those two views and placed it on the report.

    But now wen i see the report i get this

    Cat_1 | Cat_2
    500 | 800
    300 | 800
    500 | 400
    300 | 400


    While i want my report like this.

    Cat_1 | Cat_2
    500 | 800
    300 | 400

    Please help me guys, have to build a small program.
    Reply With Quote
      #2    
    Old March 11th, 2004, 02:38 PM
    cmpgeek's Avatar
    cmpgeek cmpgeek is offline
    Junior Member
     
    Join Date: Mar 2004
    Location: NE georgia USA
    Posts: 5
    cmpgeek is an unknown quantity at this point (<10)
    i am not sure i am reading this correctly, but i am going to take a stab at helping just in case...
    have you tried grouping your results by category?

    hope this helps...
    __________________
    i run crystal 8.5 on an Oracle 8 database...

    cmpgeek
    Reply With Quote
      #3    
    Old March 11th, 2004, 04:29 PM
    malleyo malleyo is offline
    Member +
     
    Join Date: Jul 2003
    Location: Florida
    Posts: 651
    malleyo has a spectacular aura about (125+)malleyo has a spectacular aura about (125+)
    What about rewriting your query to:

    select amount from transaction where category = 1 OR category = 2
    Order By category

    That will get your results in the form of:

    Amount | Cat_id
    500 | 1
    300 | 1
    800 | 2
    400 | 2

    ... unless category 1 and category 2 come from 2 different tables. If they do, you could use a JOIN.
    __________________
    I'd rather be wakeboarding...
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual Basic Programming > Crystal Reports


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 08:07 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009