JuanSanchez
Programmer
I'm trying to convert this T-SQL to PL/SQL. This is part of a view on my MS SQL 2k server. But I need to use it in a DTS package to pull data from our Oracle server. I'm trying to get the weekending 2 weeks previous. Weeks end on saturday in this script. Thanks in advance. The server does not have the data till Wednesday if your wondering about the numbers jumping up.
Code:
select
convert(varchar(12),dateadd(ww, -2, dateadd(dd, 7 - (case datename(dw, getdate())
when 'Sunday' then 8
when 'Monday' then 9
when 'Tuesday' then 10
when 'Wednesday' then 4
when 'Thursday' then 5
when 'Friday' then 6
else 7 end), getdate())),101)