Integer values showing in Decimals

(2 posts) (2 voices)

Tags:

No tags yet.

  1. bushraj, Member

    Hey i have query which gives count in integer like 386 . But when i run the same query in MyDBr it shows in decimal format like 386.00. Why this is happening ? My query is as follows :

    select 'SOD Open Count',(

    (SELECT count(*) FROM rpworkflow.all_issues_modified
    where Current Status not in ('close','Veritas Investigation Closed','','Not Submitted YET'))

    -

    (select if(dayname(curdate())='Saturday'||dayname(curdate())='Sunday','-',round(count(*),2
    )) as SOD
    from wf_workflow.app_delegation ad, wf_workflow.application a, wf_workflow.content c
    Where a.app_uid=ad.app_uid
    AND c.con_id=ad.tas_uid
    AND c.con_value in ('submission')
    and del_thread_status='closed'
    and day(ad.del_delegate_date)=1
    AND year(ad.del_delegate_date)=year(curdate())
    AND month(ad.del_delegate_date)=month(curdate())
    )
    +
    (select count(*) as EOD
    from wf_workflow.app_delegation ad, wf_workflow.application a, wf_workflow.content c
    Where a.app_uid=ad.app_uid
    AND c.con_id=ad.tas_uid
    AND c.con_value like ('%close%')
    and day(ad.del_delegate_date)=1
    AND year(ad.del_delegate_date)=year(curdate())
    AND month(ad.del_delegate_date)=month(curdate())
    )
    ) AS A

    Please help .. Awaiting for your reply.

    Thanks.

  2. myDBR Team, Key Master

    myDBR formats the number as a decimal number if the query produces a decimal number.

    The part of the query that makes your result to be a decimal number is

    if(dayname(curdate())='Saturday'||dayname(curdate())='Sunday','-',round(count(*),2))

    P.S Is also has an error as you should always return a number instead of '-' string when you are using the value in calculation.

    --
    myDBR Team


Reply

You must log in to post.