Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with conditional results

Status
Not open for further replies.
Sep 27, 2001
179
AU
Hi

I wish to execute a simple SELECT statement that will evaluate a field that holds either a Y or N value and return either 1.175 for a Y value and 0.00 for a N value.
For each row in the result set.

Thanks Rob

 
[blatantly plagarised]
Select < your column list>,
<Y or N col> =
case (<Y or N col>)
when 'Y' then 1.175
when 'N' then 0.00
end
from <table>
[/blatantly plagarised]

Look up the CASE statement in BOL for more detail

Rhys
"There are some oddities in the perspective with which we see the world. The fact that we live at the bottom of a deep gravity well, on the surface of a gas-covered planet going around a nuclear fireball 90 million miles away and think this to be normal is obviously some indication of how skewed our perspective tends to be"
DOUGLAS AD
 
Thanks for your reply, I did an found what I was looking for. Had time constraints for this so hence a simple question was posted.

Robert Colborne
----------------------------
Certified GoldMine, AccPac CRM and SuperOffice consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top