Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
MySQL Question
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="JSEB" data-source="post: 468230" data-attributes="member: 92333"><p>I am new to MySQL and I am trying to figure out this problem and I have used every resource I know of.</p><p></p><p>So basically the code is</p><p>[CODE=sql]SELECT EMPLOYEE.EMP_NUM, EMP_LNAME, SUM(ASSIGN_HOURS) AS SumOfASSIGN_HOURS, SUM(ASSIGN_CHARGE) AS SumOfASSIGN_CHARGE</p><p>FROM EMPLOYEE, ASSIGNMENT</p><p>WHERE EMPLOYEE.EMP_NUM = ASSIGNMENT.EMP_NUM</p><p>GROUP BY EMP_NUM</p><p>ORDER BY EMP_NUM;</p><p>[/CODE]</p><p></p><p>And it looks like this:</p><p><a href="https://prnt.sc/10nqkah" target="_blank">https://prnt.sc/10nqkah</a></p><p></p><p>I need the decimals in the numbers to be rounded upwards to match this: <a href="https://prnt.sc/10nqkw2" target="_blank">https://prnt.sc/10nqkw2</a></p><p></p><p>I have tried using the round() tag but I am getting syntax errors when using that.</p><p>[automerge]1615952114[/automerge]</p><p>I actually just found out a working way to do it:</p><p>[CODE=sql]SELECT ASSIGNMENT.EMP_NUM,</p><p> EMPLOYEE.EMP_LNAME,</p><p> FORMAT(Sum(ASSIGNMENT.ASSIGN_HOURS),1) AS SumOfASSIGN_HOURS,</p><p> FORMAT(Sum(ASSIGNMENT.ASSIGN_CHARGE),2) AS SumOfASSIGN_CHARGE</p><p>FROM EMPLOYEE, ASSIGNMENT</p><p>WHERE EMPLOYEE.EMP_NUM = ASSIGNMENT.EMP_NUM</p><p>GROUP BY ASSIGNMENT.EMP_NUM, EMPLOYEE.EMP_LNAME</p><p>[/CODE]</p><p>[automerge]1616038451[/automerge]</p><p>Following up on this problem, I now have the correct table/information I now need to remove comma's from numbers? I have searched but I do not fully understand?</p><p></p><p>[URL unfurl="true"]https://prnt.sc/10op3je[/URL]</p></blockquote><p></p>
[QUOTE="JSEB, post: 468230, member: 92333"] I am new to MySQL and I am trying to figure out this problem and I have used every resource I know of. So basically the code is [CODE=sql]SELECT EMPLOYEE.EMP_NUM, EMP_LNAME, SUM(ASSIGN_HOURS) AS SumOfASSIGN_HOURS, SUM(ASSIGN_CHARGE) AS SumOfASSIGN_CHARGE FROM EMPLOYEE, ASSIGNMENT WHERE EMPLOYEE.EMP_NUM = ASSIGNMENT.EMP_NUM GROUP BY EMP_NUM ORDER BY EMP_NUM; [/CODE] And it looks like this: [URL]https://prnt.sc/10nqkah[/URL] I need the decimals in the numbers to be rounded upwards to match this: [URL]https://prnt.sc/10nqkw2[/URL] I have tried using the round() tag but I am getting syntax errors when using that. [automerge]1615952114[/automerge] I actually just found out a working way to do it: [CODE=sql]SELECT ASSIGNMENT.EMP_NUM, EMPLOYEE.EMP_LNAME, FORMAT(Sum(ASSIGNMENT.ASSIGN_HOURS),1) AS SumOfASSIGN_HOURS, FORMAT(Sum(ASSIGNMENT.ASSIGN_CHARGE),2) AS SumOfASSIGN_CHARGE FROM EMPLOYEE, ASSIGNMENT WHERE EMPLOYEE.EMP_NUM = ASSIGNMENT.EMP_NUM GROUP BY ASSIGNMENT.EMP_NUM, EMPLOYEE.EMP_LNAME [/CODE] [automerge]1616038451[/automerge] Following up on this problem, I now have the correct table/information I now need to remove comma's from numbers? I have searched but I do not fully understand? [URL unfurl="true"]https://prnt.sc/10op3je[/URL] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
MySQL Question
Top