CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    12

    Crystal reports grouping time stamps by hour

    I made a report in crystal reports and its cross tabbed with Times on top, what i need to do is be able to group the times by hour but I have no clue how to do that

    right now it looks like this:

    8:01 8:11 8:15 8:45 9:15 9:34 and so on

    it needs to be like this
    8:00 9:00 and so on having everything in the 8-9 range under 8 and 9-10 under 9 and so on

    I am using a Ms sql database and taking info from a number field numbers are in the format 800 for 8 oclock 930 for 9 thirty and so on

    how would I group them like this

  2. #2
    Join Date
    May 2003
    Posts
    163

    Re: Crystal reports grouping time stamps by hour

    I'm not sure whether this folg is a right solution. but it'll work.

    Try to create a formula and check the numeric value. Form a group using code
    Like

    If {table.field} in [800 to 830] then
    1
    else if {table.field} in [831 to 900] then
    2
    etc

    Then group the report using this formula. To display the time interval create one more formula. Refer the previous formula here

    i.e
    if {@prev} = 1 then
    "8.00 - 8.30"
    etc

    Hope this will work.

  3. #3
    Join Date
    Sep 2004
    Posts
    12

    Re: Crystal reports grouping time stamps by hour

    Thanx I will try that out,

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

Featured