I have a query below:
- select DATEDIFF(DAY, DateRequested, GETDATE()) as NumberOfDays from tblSeriesRequest
- UPDATE [dbo].[tblSeriesRequest] SET [IsCancelled] = 1
I tried the query below but it updates the whole rows.
- if exists(select 1 from tblSeriesRequest where (DATEDIFF(DAY, DateRequested, GETDATE())) > 30 and IsApproved <> 1)
- begin
- UPDATE [dbo].[tblSeriesRequest] SET [IsCancelled] = 1
- end
Can anyone show me how to do this? Many thanks in advance

Jignesh KumarPosted Aug 12, 2018, 11:41 PM
Jignesh KumarPosted Aug 13, 2018, 2:04 AM
Jes SiePosted Aug 13, 2018, 1:27 AM
Jes SiePosted Aug 12, 2018, 11:32 PM