In an SQL statement how does one return a string value dependent on the value in another column?
Language is T-SQL
i want a sub query to return the result of the following pseudo code expression into a new column called Current_YTD
IF(Committed_Date >= '01/04/2011') THEN Current_YTD = 'Y'
Committed_Date is a DateTime type
Assuming SQL Server (appears likely from your question history), you need the CASE statement: