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 |
|
gjc
Starting Member
2 Posts |
Posted - 2010-12-09 : 04:27:33
|
| I'm trying to convert a value from a field. Basically I have a priority field for records with a default value of 1000 but in certain cases I want to present this value as a 0 on an asp page. I don't want to change the value at all in the database. Any ideas would be welcome!Many thanks. |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2010-12-09 : 04:47:02
|
| Depends on how you retrieve itIf you want to do it in a select statement thenselect Priority = case when priority = 1000 and <whatever else> then 0 else priority endfrom ...==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2010-12-09 : 04:51:18
|
| if it is only for display purpose you can do this.select (column-column)from <table>.this will make the value as 0.because iam substracting the value from the same column. |
 |
|
|
gjc
Starting Member
2 Posts |
Posted - 2010-12-09 : 04:59:08
|
| Many thanks, I've done it with the case option. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-12-09 : 05:23:54
|
quote: Originally posted by ahmeds08 if it is only for display purpose you can do this.select (column-column)from <table>.this will make the value as 0.because iam substracting the value from the same column.
That will be ZERO for every row / every value of [column], and not just when [column] = 1000In which case you might just as well doselect 0 from <table> |
 |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2010-12-09 : 05:29:45
|
| thanx for your reply.but i wil filter the records in the where condititon.then how come it will affect all the rows. |
 |
|
|
|
|
|