How to Convert the Decimal

  • Dear friends;

    pls Help me;

    WITH CTE

    AS

    (

    SELECT *,Extmark / 2 [SUMOFEXTERNAL] FROM Regular where registerno between 081020100001 and 081020100031 and courseid='071120067'

    AND Extmark NOT IN('Discontinue')

    )

    SELECT REGISTERNO,COURSEID,COURSENAME,PROGRAMMENAME,SEM,BRANCHCODE,INTMARK,EXTMARK,TOTALMARK,[SUMOFEXTERNAL] + INTMARK [TOTAL] FROM CTE

    The Result's of the given Query is

    SEm

    011020469895

    011020469091

    011020469292

    011020509999

    011020469794

    01102050100100

    011020469694

    011020469694

    011020469794

    011020469794

    011020509999

    011020469794

    01102050100100

    011020469794

    Hai; How can i Convert the Decimal Number ; For Example

    Row_num=5

    =97/2= 48.5

    48.5+46=94.5 Ans

    Pls How To Get the output

    Thanks & Regards;

    A.Faijurrahuman

  • If i understand you correctly you want to remove the decimal point, what do you want to do to the answer

    do you want to just remove the .5 or do you want to round the number up or down so

    4.6

    is changed to

    either

    4

    or

    5

    and if it is 4.3

    is changed to

    4

    or

    5

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

  • Hai;

    To Round the Number Like that 4.6 then '7' (or) 4.4 then '4'

  • the round function will do that, amongst others.

    select round(4.4,0)

    4.0

    select round(4.6,0)

    5.0

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply