Results 1 to 7 of 7

Thread: Roudning off

  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: Roudning off

    Hi all I have a View of which i have made a report out of
    Code:
    SELECT     [Date of Referral], [Contact Date], [Referral Status], RequiredHours, [Mo Hours], [Parent Last Name], [Parent First Name], [Catagory for hours], 
                          [Hours earned]
    FROM         HoursEarned
    WHERE     ([Contact Date] BETWEEN @Beginning_ContactDate AND @Ending_ContactDate) OR
                          ([Parent Last Name] = @ParentLastName)
    ORDER BY [Parent Last Name]
    the results I get i have attached. I am wondering instead of it saying

    17.33333333
    how would you round that off??
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by desireemm
    how would you round that off??
    with your application language (php? perl? coldfusion? java? c? -- they can all do it)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    when I run the report on Reporting services. I dont know how to round the numbers off. Hope I'm explaining that correctly. How do I incorporate that into the Select Statement.
    =SUM(Fields!RequiredHours.Value)/60 result is = 0.291666666667

    How would I get that from 22.63333333333333 to 22.63
    Last edited by desireemm; 05-30-09 at 22:13.

  4. #4
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    WOOHOO never mind I figured it out. you go into the properties of the filed in reporting services then in the tex box properties you click on the FORMAT tab then where it says FORMAT CODE type in ##.## and there ya go

    instead of 22.6333333
    22.63

  5. #5
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    I have a question on the same problem, but the question is how would I create a running total in reporting services??

  6. #6
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    How to create a running total out of the Hours Due, because each time they Earn more hours the Hours Due will decrease

    Hours Required
    40

    Hours Earned

    1

    (Running total)
    Hours Due

    39.00

    Hour Required
    40.0

    Hours Earned
    2

    Hours Due

    37.00
    Attached Files Attached Files

  7. #7
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    I think I got it figured out, I looked among my script and found a similar report I did. I think this is close to what I am looking for, I looked a the report that I did on reporting services and its pretty close to what I am looking for. so I need a cul



    Code:
    USE [IncidentReportsdb]
    GO
    /****** Object:  StoredProcedure [dbo].[TotalLosses_Type]    Script Date: 10/29/2008 14:17:36 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[TotalLosses_Type](@StartDate datetime,
    @EndDate datetime)
    AS SELECT     COUNT ([Violation Type]) AS Total, [Violation Type], SUM([Loss]) AS [Total_Losses], [Inspector]
    FROM         dbo.Revised_MainTable
    WHERE      (Date BETWEEN @StartDate AND @EndDate)
    GROUP BY [Violation Type], [Inspector]





    heres an example I hope this helps, each student is responsible for doing some kind of activity for a certain amount of time per week, usually 30-40 hours and we are trying to keep track of those hours. this report of the students activity goes to the state. so if a student is required to do 40 hours for week 1 and only earns 1 hour then he is still due 39.00 hours. trying to create a cumulative sum

    week 1
    [Hours required]
    40

    [category of hours]
    Cultural

    [Hours Earned]
    1

    [Hours Still due]
    39.00



    Week 2

    [Hours Required]
    79.00

    [Category of Hour]
    Cultural

    [Hours Earned]
    1


    Hours still due]

    78.00
    Last edited by desireemm; 06-02-09 at 14:52.

Posting Permissions

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