sto ricevendo questo erroreSQL Server: aritmetico errore di overflow conversione espressione tipo di dati int
msg 8115, livello 16, stato 2, riga 18
Errore di overflow aritmetico conversione espressione tipo di dati int.
con questa query SQL
DECLARE @year VARCHAR(4);
DECLARE @month VARCHAR(2);
-- START OF CONFIGURATION SECTION
-- THIS IS THE ONLY SECTION THAT SHOULD BE MODIFIED
-- SET THE YEAR AND MONTH PARAMETERS
SET @year = '2013';
SET @month = '3'; -- 1 = January.... 12 = Decemeber.
-- END OF CONFIGURATION SECTION
DECLARE @startDate DATE
DECLARE @endDate DATE
SET @startDate = @year + '-' + @month + '-01 00:00:00';
SET @endDate = DATEADD(MONTH, 1, @startDate);
SELECT
DATEPART(YEAR, dateTimeStamp) AS [Year]
, DATEPART(MONTH, dateTimeStamp) AS [Month]
, COUNT(*) AS NumStreams
, [platform] AS [Platform]
, deliverableName AS [Deliverable Name]
, SUM(billableDuration) AS NumSecondsDelivered
FROM
DeliveryTransactions
WHERE
dateTimeStamp >= @startDate
AND dateTimeStamp < @endDate
GROUP BY
DATEPART(YEAR, dateTimeStamp)
, DATEPART(MONTH, dateTimeStamp)
, [platform]
, deliverableName
ORDER BY
[platform]
, DATEPART(YEAR, dateTimeStamp)
, DATEPART(MONTH, dateTimeStamp)
, deliverableName
E cosa stai chiedendo esattamente? L'errore è ovvio: si finisce con un numero troppo grande per il tipo di dati 'int'. –
Si prega di indicare quale numero è troppo grande per il tipo di dati? grazie – user2270544
Per le date come stringa, devi sempre utilizzare il formato ** ISO-8601 ** - 'AAAAMMGG' - solo questo formato è garantito per ** qualsiasi ** lingua e/o impostazioni internazionali –