Re: Using if statement in SQL from MS Access
From: Steve Kass (skass_at_drew.edu)
Date: 07/22/04
- Next message: Don: "Sorting on varchar field"
- Previous message: anonymous_at_discussions.microsoft.com: "Using if statement in SQL from MS Access"
- In reply to: anonymous_at_discussions.microsoft.com: "Using if statement in SQL from MS Access"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Jul 2004 02:44:15 -0400
There is a CASE expression that can be used for this. Look it up in the
index of Books Online - it will go something like
CASE WHEN [fieldname] = 'Help' THEN 'HELP' ELSE [fieldname] END
There are many differences between the SQL syntax of Access and of SQL
Server, so don't expect things to just work without modification.
Steve Kass
Drew University
anonymous@discussions.microsoft.com wrote:
>HI,
>
>I am new to SQL but have experiene in access. I would like
>to convert the following from access SQL to proper SQL.
>Can anyone help. How should this be done in SQL??
>
>[new_field_name]: iif([fieldname]="Help","HELP",
>[fieldname])
>
>
- Next message: Don: "Sorting on varchar field"
- Previous message: anonymous_at_discussions.microsoft.com: "Using if statement in SQL from MS Access"
- In reply to: anonymous_at_discussions.microsoft.com: "Using if statement in SQL from MS Access"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|