Access to SQL (IIF)
Can somebody help me out with a bit of a problem I'm having with a query conversion.
I've got a query in Access that I want to make into a view on the server, but since SQL Server doesn't like IIF, it's making life a bit hellish.
Basically, this is the statement I need to fix.
IIf(Table1.AdmDate>Table2.AdmDate-0.25 And Table1.AdmDate<Table2.AdmDate,Table1.AdmDate,Table 2.AdmDate)
I thought it would be:
CASE Table1.AdmDate
WHEN >Table1.AdmDate-0.25 AND
<Table2.AdmDate Then Table1.AdmDate
ELSE Table2.AdmDate
END
Basically what I'm wanting to happen is this:
If Table1.AdmDate is up to 6 hours before Table2.AdmDate, then return Table1.AdmDate, otherwise, return Table2.AdmDate
Any help would be appreciated
I am a loud man with a very large hat. This means I am in charge
__________________
<hr noshade size=\"1\"><i><font color=\"blue\">I am a loud man with a very large hat. This means I am in charge</i></font id=\"blue\">
|