Can anyone help to converting following sql to T-SQL?
SELECT *
FROM ( SELECT LEVEL n, TO_DATE ('31/12/2010', 'DD/MM/YYYY') + NUMTODSINTERVAL (LEVEL, 'day') CurrDate
FROM DUAL
CONNECT BY LEVEL <= 2000);
This should do the trick, I think
select dateadd(d, number, '2010-12-31')
from master..spt_values
where type='p'
and number between 1 and 2000
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With