Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a CASE WHEN in a WHERE clause
Message
De
29/07/2015 16:14:21
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01622652
Message ID:
01622657
Vues:
36
>I suggest to re-write this statement.
>
>1. Start from a select statement to return what you will need.
>
>2. Once you get your select statement working properly, turn it into MERGE command.

The original select was what I needed. I only needed to add a condition in the WHERE clause to use one way or another based on the fact that if there is a company or not. The default, is to use the province from the Company table, if we have a Client.NoCompany. Otherwise, we use the province from the Research table, if we have Client.NoCompany=0 and a Client.NoResearch>0.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform