Results 1 to 5 of 5

Thread: ** Resolved ** Sorting Columns Descending or Ascending

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2003
    Posts
    89

    Arrow ** Resolved ** Sorting Columns Descending or Ascending

    Hello,

    I'm using Crystal Reports.NET.

    I have 2 questions:

    1) Is there anyway to sort a column by descending or ascending order by clicking on the column header?


    2) I have a datetime field in SQL Server, but when I made the report in the designer, the years are not sorted correctly.

    It's sorted like this:

    1/2/2003
    5/24/2001
    7/3/1999

    Is there a way to sort by year, not by the month?

    Thanks for any solutions on either of these questions


    Chris
    Last edited by Trancedified; Mar 3rd, 2004 at 12:04 PM.

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    I have done the date theng also. I created a formula equal to datepart("yyyy",data field) and made it not visible. The I sort on that field.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2003
    Posts
    89
    Pasvorto,


    Can you please elaborate on how to create this field? I am new to Crystal Reports.


    Thanks


    Chris

  4. #4
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381
    I don't see any reason why CR would sort your date in that kind of a manner UNLESS your are converting your datetime field into a text string to remove the time part in your report.

    What you should do is to create a formula based on your SQL datetime field and format this so that only the date will be shown then sort the report based on this formula.

    EX.
    (1) Create a formula "DateSort"
    (2) Edit formula where "DateSort" = DATEVALUE({Table.DateField})


    I'm using CR9 so I am not sure if DATEVALUE() function is available with your version. If it is, then this would be your best bet.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2003
    Posts
    89

    ** Resolved **

    Open the report
    Right Click White Area Report OPTIONS....


    Ensure Convert Date-Time Field is To Date

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width