Computing.Net > Forums > Programming > powerbuilder SQL code question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

powerbuilder SQL code question

Reply to Message Icon

Name: Mack
Date: July 26, 2002 at 09:11:14 Pacific
Comment:

Ok - I'm trying to do a sort in powerbuilder 6.5. What I have is this situation....I am sorting by this field - let's just call it "priority"

Presently "priority" can be set to H,M, or L (for high, medium, low - respectively). I need to sort by this field - but it sorts alphabetically - so it is not accurate.

I'm trying to make an expression in powerbuilder SQL to set H=1 M=2 and L=3. I cannot seem to get it to work. What I have tried is:

if(priority = 'H', 1, 'M', 2, 'L', 3, 4)
--4 being if it isn't prioritized at all--

It gives me an error - the only way I can get it to work is if i do something like...

if(priority = 'H', 1, 2)
This assigns all others to the value "2" - How can i get this to work?

Any help is appreciated very much - i'm new to powerbuilder!



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: powerbuilder SQL code question

PLEASE HELP! Powerbuilder, SQL, Win98 www.computing.net/answers/programming/please-help-powerbuilder-sql-win98/1361.html

SQL Code in Webpages www.computing.net/answers/programming/sql-code-in-webpages/9813.html

MS SQL Server question www.computing.net/answers/programming/ms-sql-server-question/9497.html