Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Get the latest stage

$
0
0

Hi Expert

I have one table in SQL and the column are as follow

NAME, STAGE1, STAGE2, STAGE3, STAGE4, STAGE5

and the Data are as follow

Name1, 01-02-2020, 15-02-2020, 30-03-2020, , 

The Name column having only names, and all other Stages column having Dates.

now in l wan to create computed column after Stage5 called Status and want the result where last stage.

in above case Name 1 having last date in Stage3 so i want status like "Stage4 Pending".

if any Name having last date in Stage4 column then i need status like "Stage5 Pending".

if any Name having last date in Stage1 column then i need Status like "Stage2 Pending".

and whenever i insert date then status should be change automatically.


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>