Hello. I have an Informix SQL statement that I need to run in MS SQL
Server. When I try to execute it I get the following error message from
Query Analyzer:
Server: Msg 195, Level 15, State 10, Line 4
'date' is not a recognized function name.
Can anyone help me convert this informix sql statement into and MS Sql
Statement? Here is the query I have:
select
a.comp_code,
a.comp_date,
case when date(date(date(comp_date - day(comp_date) +1) - 2 units
month) - 1 units day) < b.inception_date then b.inception_date
else date(date(date(comp_date - day(comp_date) +1) - 2 units month) - 1
units day)
end prior_date,
a.net_return,
a.net_uv,
a.gross_return,
a.gross_uv,
a.estimated_flag
from composite_perf a, composite_detail b
where
(month(a.comp_date) in (3,6,9,12) or a.comp_date = b.inception_date)
and a.comp_code = 'AEU'
and a.comp_code = b.comp_code
into #tmp_composite_data
Thanks in advance.