zektheiguana
IS-IT--Management
I'm a complete SQL Noob so if this is ridiculously easy, I'll apologize now!
I'm trying to set a column "Status" in a record based on column DueDate compared to the current date as well as the contents of another column called DateClosed.
So in non-SQL syntax, what I'm looking at is
IF DueDate > CurrentDate AND DateClosed = Null then Status = 'Overdue' ELSE
IF DueDate < CurrentDate AND DateClosed = Null then Status = 'Open'
ELSE
Status = "Closed"
I've tried using a CASE statement in both the Computed Column field and setting it up with a CASE statement in a user defined function, but I guess I'm not getting the syntax...I'm using VS 2010
Any help would be very much appreciated!!
I'm trying to set a column "Status" in a record based on column DueDate compared to the current date as well as the contents of another column called DateClosed.
So in non-SQL syntax, what I'm looking at is
IF DueDate > CurrentDate AND DateClosed = Null then Status = 'Overdue' ELSE
IF DueDate < CurrentDate AND DateClosed = Null then Status = 'Open'
ELSE
Status = "Closed"
I've tried using a CASE statement in both the Computed Column field and setting it up with a CASE statement in a user defined function, but I guess I'm not getting the syntax...I'm using VS 2010
Any help would be very much appreciated!!