| Author |
Topic  |
|
|
ahmeds08
Constraint Violating Yak Guru
India
444 Posts |
Posted - 09/25/2012 : 04:59:25
|
Hi All, I am getting this error when this query is executed: The data types numeric and int are incompatible in the '^' operator.
query is: select 13.2846176*(10/5)^4 -24.27436623*(20/5)^3 + 14.27967309*(30/5)^2 + -2.455442334*(40/5) + 0.114953113
Please help. |
|
|
senthil_nagore
Flowing Fount of Yak Knowledge
India
1006 Posts |
Posted - 09/25/2012 : 05:28:50
|
'^' Denotes XOR operator in T-sql, you have to use Power() function
select power(13.2846176*(10/5),4 )- power(24.27436623*(20/5),3) + power(14.27967309*(30/5),2) + -2.455442334*(40/5) + 0.114953113
Senthil Kumar C ------------------------------------------------------ MCITP - Database Administration SQL SERVER 2008 MCTS - Database Development SQL SERVER 2008 |
 |
|
|
ahmeds08
Constraint Violating Yak Guru
India
444 Posts |
Posted - 09/25/2012 : 05:39:30
|
quote: Originally posted by senthil_nagore
'^' Denotes XOR operator in T-sql, you have to use Power() function
select power(13.2846176*(10/5),4 )- power(24.27436623*(20/5),3) + power(14.27967309*(30/5),2) + -2.455442334*(40/5) + 0.114953113
Senthil Kumar C ------------------------------------------------------ MCITP - Database Administration SQL SERVER 2008 MCTS - Database Development SQL SERVER 2008
Thanks a lot for the help. I have run the query with some additions to it,but i get error "max functions requires on argument" query is: select min(max(power(13.2846176*(10/5),4 )- power(24.27436623*(20/5),3) + power(14.27967309*(30/5),2) + -2.455442334*(40/5) + 0.114953113,0),1))
please help please. |
 |
|
|
senthil_nagore
Flowing Fount of Yak Knowledge
India
1006 Posts |
Posted - 09/25/2012 : 05:55:25
|
What you tring to achieve it? min/max requires only one expression..
Check this
http://msdn.microsoft.com/en-us/library/ms187751.aspx
Senthil Kumar C ------------------------------------------------------ MCITP - Database Administration SQL SERVER 2008 MCTS - Database Development SQL SERVER 2008 |
Edited by - senthil_nagore on 09/25/2012 05:55:50 |
 |
|
| |
Topic  |
|