Hello I am working on SQL query that updates my container automatically but I got this error that makes my SQL query don't work :
' The subquery return multiple values. This is not allowed when the subquery follows =,! =, <, <=,>,> = Or when it is used as an expression. '
This is my full query and the part that makes the problem is under :
- INSERT INTO [CRM_GAT].[dbo].[Table_Audit_Sinistres]([Libelle_Etape],[time],[Count_Input],[NumSinistre],[Count_Output])
- VALUES ('FIN_TR_Sinistre',GEtDATE()
- ,(SELECT COUNT(*)FROM [CRM_GAT].[dbo].[Sinistre] WHERE ([CodeValidation] is null or [CodeValidation]=0) and [DateOperation] between DATEADD(day,-10, GETDATE()) and GETDATE()),
- (SELECT [NumSinistre]FROM [CRM_GAT].[dbo].[Sinistre] where [NumContrat] in(select [NumContrat] from [CRM_GAT].[dbo].[Contrats] where [CodeProduit]!=7940 and [DateOperation] between DATEADD(day,-10, GETDATE()) and GETDATE())
- and [DateOperation] between DATEADD(day,-10, GETDATE()) and GETDATE() and ([CodeValidation] is null or [CodeValidation]=0 ))
- ,(SELECT COUNT(*) FROM [CRMGAT].[dbo].[Sinistre] WHERE [CtrCodeSource]=1 and [DateOperation] between DATEADD(day,-10, GETDATE()) and GETDATE()))
-
- SELECT [NumSinistre]FROM [CRM_GAT].[dbo].[Sinistre] where [NumContrat] in(select [NumContrat] from [CRM_GAT].[dbo].[Contrats] where [CodeProduit]!=7940 and [DateOperation] between DATEADD(day,-10, GETDATE()) and GETDATE())
- and [DateOperation] between DATEADD(day,-10, GETDATE()) and GETDATE() and ([CodeValidation] is null or [CodeValidation]=0 )
I need to get all the values and insert them in my table.
Please can someone help me