0 - 4 of 4 tags for concatenate

So, I'm not sure why this statement isn't working properly.

MERGE INTO table1 as a
USING table2 as b
ON a.date = b.date AND a.id = b.id
WHEN MATCHED THEN
UPDATE SET col2 = CAST(a.col2 as VARCHAR(3)) ||','|| CAST(b.col2 as VARCHAR(3))
WHEN NOT MATCHED THEN
INSERT (id, col2, date)
VALUES (b.id, b.col2, b.date);

 

How do I combine multiple Select queries?

I have 7 queries run separately. Each query return 2 columns. Count(of something), (date)

Date Range is Fixed for each query Set to 1 Week only.

Good Afternoon,

My question is this what I want to do is to a date depending on the month to add the last day of the month.

For example I get:

I've had some problems with joining to a concatenated variable and although I've fixed the problem I'd like to understand what happened here.

As background, in a transaction table we have the first digit of the account number was dropped for a couple of days and so we have a number of records where the account number needs a single digit added to the front.

We basically wanted to do a really simple query to find out how many transactions have been made on an account. However, when a join on the reconstructed account number didn't work.

The abstraction of the code is below: