User475983607 posted
Your requirement for using a random number is difficult to understand. What is the actual requirement? Check if there is an IN TIME?
IF OBJECT_ID('tempdb..#Timesheet') IS NOT NULL
DROP TABLE #Timesheet
CREATE TABLE #Timesheet (
[NAME] VARCHAR(10),
InTime TIME(2) NULL,
OutTime TIME(2) NULL,
)
INSERT INTO #Timesheet ([NAME], InTime, OutTime)
VALUES('AAA', '09:09', '20:25'),
('BBB', '09:15', '18:55'),
('YYY', NULL, NULL)
SELECT [NAME],
InTime AS [IN TIME],
OutTime AS [OUT TIME],
CASE WHEN InTime IS NULL THEN 'Absent' ELSE 'Present' END AS [STATUS]
FROM #Timesheet
In you r future post, please provide sample code like above so we have a better understanding of your design.