Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simplifying WHERE clause with CASE WHEN
Message
De
21/04/2015 17:58:26
 
 
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:
01618887
Message ID:
01618916
Vues:
37
>Well, to me the re-factored command is much easier to understand and debug. But it's up to you to take the suggestion and try it or not.

This would be better:
...
     WHERE BusinessTime.NoProvince=
      (SELECT COALESCE((SELECT Company.NoProvince FROM Company WHERE Company.NoCountry=1 AND Company.Numero=Client.NoCompany),84)) AND
      BusinessTime.NoHoliday=0 AND
      BusinessTime.Start<Client.FirstDate AND
      BusinessTime.[End]>=Client.SecondDate) Temp)
...
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