|
-
May 1st, 2001, 08:23 AM
#1
Query with SQL Server
Hello
I have problem with Query on SQL Server DB.
I want to show field with condition, in Access I wrote it that way:
SELECT iif (condition, field1, field2), field3 FROM Table1
I try it that way but SQL Server dont recognize 'iif' function.
Is any body know how do i do it in SQL Server ? (without using Store Procedure).
Thanks for any help.
-
May 1st, 2001, 08:45 AM
#2
Re: Query with SQL Server
look at the case structure for sql server. You can include this in your select.
select case condition field1 else field2, field3 from table1
That is only the rough syntax but the case statement will do what you are looking for.
-
May 1st, 2001, 09:01 AM
#3
Re: Query with SQL Server
I try it and it don't work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|