Click here to Skip to main content
15,900,384 members

Comments by Jaichithra (Top 3 by date)

Jaichithra 10-Jan-23 9:06am View    
Thank you @Richard Deeming. Your solution worked.
Jaichithra 10-Jan-23 5:19am View    
Hi Richard Deeming,
I tried your code, yet the whole calendar is only getting displayed. I want to display only the current date and past 5 dates.
Jaichithra 16-Sep-22 6:31am View    
Thank you for the suggestion, however post using AS I'm getting below error

Error
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.


SELECT
BM.Batch_id AS B_ID,
TPP.Ntlg,
(SELECT ((CAST(CAM.Emp_ID AS VARCHAR(10))) + ' - ' + NAME) FROM CLIENT_ACCESS_MASTER CAM WHERE CAM.Ntlg = TPP.Ntlg)[User Name],
TPP.Batch_id ,
(CASE WHEN DATEPART(hour,TPP.Entered_date) = 0 THEN (CAST((23) AS Varchar(10))) ELSE (CAST((DATEPART(hour,TPP.Entered_date)-1) AS Varchar(10))) END + '-' + CAST((DATEPART(hour,TPP.Entered_date)) AS Varchar(10))) [Hour]
INTO ##TempProductionData
FROM Batch_Master BM WITH(NOLOCK)
INNER JOIN Tran_Prod_Entry TPP WITH(NOLOCK) ON BM.Batch_id = TPP.Batch_Id
AND TPP.Batch_Status IN (@COMPLETEDSTATUS)
AND Client_id = @CLIENT_ID AND TPP.Entered_Date = @ReportDate