SQL server 2012 query.
declare IDList cursor for (SELECT ID FROM [dbo].[News] WHERE PublishFromDate BETWEEN cast(@fromDate as datetime) AND cast(@toDate as datetime)) order by PublishFromDate
The above cursor wrks fine. But when add order by "desc" make it is not working.
declare IDList cursor for (SELECT ID FROM [dbo].[News] WHERE PublishFromDate BETWEEN cast(@fromDate as datetime) AND cast(@toDate as datetime)) order by PublishFromDate desc
please help with this
thank you in advance