I have a sql-query where i do not know my mistake therefore it would be nice if you could help.
SELECT
SUM(b.HardBounceCount) AS HardBounceCount,
SUM(b.SoftBounceCount) AS SoftBounceCount,
SUM(b.BlockBounceCount) AS BlockBounceCount,
SUM(b.UnknownBounceCount) AS UnknownBounceCount,
SUM(b.TechnicalBounceCount) AS TechnicalBounceCount,
SUM(b.BounceCount) AS BounceCount,
SUM(b.SendCount) AS SendCount,
b.Domain AS Domain
FROM [SubscriberBounces] b
GROUP BY b.Domain
My source data extension looks like (other values than 0 and 1 possible):
My target data extension looks like:
Do you have any advice how i can correct my query? Additionally can i insert BouncePercent directly when i add an additional line like
cast(round((SUM(b.BounceCount)*100.0)/SUM(b.SendCount),2) as numeric(5,2)) as BouncePercent,
Furthermore i have seen that datakid / Gortonington / adam spriggs have been dumping the error results in data extensions (but i could not find any of these posts, if you can share how i can dump the sql error in a data extension it would be nice too)
Errors: First - Activity View Instant Error: Inside Automation when you try to run once: Inside Automation Studio Picture 2:
First try to solve it without success:
SELECT
SUM(b.HardBounceCount) AS HardBounceCount,
SUM(b.SoftBounceCount) AS SoftBounceCount,
SUM(b.BlockBounceCount) AS BlockBounceCount,
SUM(b.UnknownBounceCount) AS UnknownBounceCount,
SUM(b.TechnicalBounceCount) AS TechnicalBounceCount,
SUM(b.BounceCount) AS BounceCount,
SUM(b.SendCount) AS SendCount,
cast(round((SUM(b.BounceCount)*100.0)/SUM(b.SendCount),2) as numeric(5,2)) as BouncePercent,
LEFT(b.Domain,128) AS Domain
FROM [SubscriberBounces_LastMonth] b
GROUP BY b.Domain
BouncePercent
column included.BouncePercent
a string in your target DE?