Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF(,,) in an SQL Server SQL Statement
Message
From
17/04/2000 10:10:52
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, United States
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00360347
Message ID:
00360354
Views:
16
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform