Question: Describe what this code is doing UPDATE @Array SET [DaysAgo] = DATEDIFF(day, [Invoice_Date], GETDATE()) UPDATE @Array SET [Time Period] = CASE WHEN [DaysAgo] BETWEEN 0

Describe what this code is doing

UPDATE @Array SET [DaysAgo] = DATEDIFF(day, [Invoice_Date], GETDATE())

UPDATE @Array SET [Time Period] =

CASE

WHEN [DaysAgo] BETWEEN 0 AND 30 THEN 'current'

WHEN [DaysAgo] BETWEEN 31 AND 60 THEN 'over 30 days late'

WHEN [DaysAgo] BETWEEN 61 AND 90 THEN 'over 60 days late'

WHEN [DaysAgo] >90 THEN 'over 90 days late'

END

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!