Re: Using if statement in SQL from MS Access

From: Steve Kass (skass_at_drew.edu)
Date: 07/22/04


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])
>
>



Relevant Pages

  • Re: recent drivel posted by Tony Rogerson on his blog
    ... to respond to a blog. ... You accept what you are used to as the norm, msdn is slow which is why I have books online installed locally, it has a link on the search through to the online version anyway - also out to a number of community sites my own included. ... Tony Rogerson, SQL Server MVP ... [UK SQL User Community] ...
    (comp.databases.oracle.server)
  • Re: Command object and batching stored procedure calls
    ... I'm using SQL Server. ... ADO Command object. ... 22 separate statements is the most I've been able to get in one CommandText, ... I'd appreciate it if you could point me to the Books Online where it's ...
    (microsoft.public.data.ado)
  • RE: Error: 25002. The specified buffer size is not valid.
    ... Try moving tempdb to a storage card using SQL CE 2.0 Books Online section ... "Specifying the Location of the Temporary Database .. ...
    (microsoft.public.sqlserver.ce)
  • Re: Command object and batching stored procedure calls
    ... batched sql statements documented? ... It is certainly documented in SQL Server ... Books OnLine. ... etc. for each network round-trip. ...
    (microsoft.public.data.ado)
  • Re: user wants access
    ... I would strongly recommend you read Books Online for this information. ... the db_securityadmin fixed database role. ... Looking for a SQL Server replication book? ...
    (microsoft.public.sqlserver.server)