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 30th, 2005, 04:19 AM
    cjard's Avatar
    cjard cjard is offline
    Sarcastic Member
    Power Poster
     
    Join Date: Oct 2003
    Location: .NET2.0 / VS2005 Developer
    Posts: 7,070
    cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)
    I need a bit more flexibility out of crystal reports..

    Hi

    I am using CR8.5 (though i have a copy of 10 that I have not installed yet because work only just bought it) and i am trying to create a crosstab query out of the following scenario:


    Imagine we have a single database table that records shop purchases:
    Field1: Date of transaction in YYYYMMDD format
    Field2: The ID of the shop
    Field3: The amount of the transaction


    Now, i want a yearly crosstab report with the months across the top (12 columns)
    and the shops down the side, so i can see how much each shop did per month over the last year

    My problem comes because I cannot find a way to make CR trim off the last 2 digits of the date, which would remove the days from the grouping and group by months:
    200501
    200502
    ...

    At the moment, im getting 365 columns because the transactions are group[ed by day rather than month:
    20050101
    20050102
    ...

    How can i change this? I'm using an Oracle back end DB and "Group on server" is ticked

    Thanks
    __________________
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ
    Reply With Quote
      #2    
    Old March 30th, 2005, 05:15 AM
    cjard's Avatar
    cjard cjard is offline
    Sarcastic Member
    Power Poster
     
    Join Date: Oct 2003
    Location: .NET2.0 / VS2005 Developer
    Posts: 7,070
    cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)cjard is a name known to all (1000+)
    Re: I need a bit more flexibility out of crystal reports..

    I've installed Crystal 10, and started playing around. I used a Formula Editor to create a new formula that simply took a Left(date, 6) reducing 20050101, 20050102 etc to just 200501
    Then i used the formula for the columns on the crosstab rather than the record date field itself

    etc.. and it *seems* to work as I want.. If anyone has any comment on a better way to do this, please let me know

    tia
    __________________
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ
    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 10:10 AM.



    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