Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Sep410
Posting Yak Master
117 Posts |
Posted - 2008-05-23 : 13:35:59
|
| I have a field in my table and I just need to change its value.Exp:5.000009999999 should be come 5.01.What is the function that I should use? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-23 : 13:39:12
|
| Check out the ROUND function in SQL Server Books Online.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-23 : 13:40:19
|
| or use CAST(YourValue as Numeric(10,2)) |
 |
|
|
Sep410
Posting Yak Master
117 Posts |
Posted - 2008-05-23 : 13:58:50
|
| Hi,Here is my query:select leaveType, hours, statusfrom entitlementRequest where clientID = 8679and status <> 'Denied'and leaveType = 'VACA'and leaveDate between '04-01-2008' and '03-31-2009'and this is result:leaveType hours statusVACA 2.25 APPROVEDVACA 3.25 APPROVEDVACA 4.0 REQUESTVACA 7.5 REQUESTVACA 7.5 REQUESTVACA 7.5 REQUESTVACA 7.5 REQUESTI just want to change the query in such a way that when the status are the same it add all the hours to gether:For example:leaveType hours statusVACA 5.5 APPROVEDVACA 34 REQUESTThen I need to add 5.5+34 . |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-23 : 14:00:42
|
| I'm so confused, what does that have to do with your original question?select leaveType, SUM(hours) AS hours, statusfrom entitlementRequest where clientID = 8679and status <> 'Denied'and leaveType = 'VACA'and leaveDate between '04-01-2008' and '03-31-2009'GROUP BY leaveType, statusTara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
 |
|
|
Sep410
Posting Yak Master
117 Posts |
Posted - 2008-05-23 : 14:01:58
|
| This is a same query as the first one. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-23 : 14:05:47
|
| There is no first query. Your original post is asking about changing a value. Does the query that I posted solve your new issue?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-23 : 14:08:14
|
quote: Originally posted by Sep410 This is a same query as the first one.
Please try to post new questions in seperate thread to avoid confusion. |
 |
|
|
Sep410
Posting Yak Master
117 Posts |
Posted - 2008-05-23 : 14:09:01
|
| sure |
 |
|
|
|
|
|