Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF(,,) in an SQL Server SQL Statement
Message
De
17/04/2000 10:10:52
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, États-Unis
 
 
À
17/04/2000 09:43:26
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00360347
Message ID:
00360354
Vues:
17
Jon,

Have you tried the CASE expression? Something like...

SELECT Timehd.empid, Timehd.date,
'newcolumn'=CASE
WHEN Timeitms.timeout>17 AND Timeitms.timein>17 THEN Timeitms.timeout-Timeitms.timein
ELSE Timeitms.timeout-17
END
FROM prewel!timehd INNER JOIN prewel!timeitms
ON Timehd.timecrdno = Timeitms.timecrdno
WHERE Timehd.date = ?m.dNextChkDate-13
AND Timeitms.jobno <> "LUNCH"
GROUP BY Timehd.empid, Timehd.date
HAVING Timeitms.timeout>17
ORDER BY Timehd.empid

HTH
George Simon, MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform