Viewing 15 posts - 61 through 75 (of 297 total)
My guess is that in reality it's the fact that you have a window function that sums transaction_amount that the engine is barking about. Mixing a group by and a...
February 1, 2023 at 4:26 pm
What's the relationship between the two tables? Are they to be joined, and if yes, on which columns?
January 31, 2023 at 8:42 pm
@ Michael L John:
Agreed, I like a typed table valued parameter for passing a set of rows to a stored procedure or between a stored procedure and a table function,...
January 31, 2023 at 7:58 pm
@Ant-Green: There seems to be a mis-match between the row values and the column definitions of the table variable. You have two integers that doesn't match up with the row...
January 31, 2023 at 7:21 pm
I don't think you can use VALUES quite like that.
This should work:
WITH ctevalues (recp_name, ing_name, qty) AS (
SELECT v.*
FROM...
January 31, 2023 at 7:13 pm
Ant-Green is correct, something is not right.
Are you connected to the correct server? Have you selected the correct database, before firing off the statement? I see no USE statement at...
January 31, 2023 at 6:11 pm
Well, the cast2.png says it clearly. The column name is not found in the Transactions table/view.
So now you have to find out what the column you stated as being named...
January 31, 2023 at 5:56 pm
You miss a comma after the CONVERT/CAST line - and you still need to change the GROUP BY.
January 31, 2023 at 5:25 pm
or instead use the ANSI style CAST:
CAST(TransactionDate AS DATE)
I know that some SQL databases support a DATE function, but SQL Server doesn't. You have to use CAST or CONVERT instead.
January 31, 2023 at 4:59 pm
BTW, there isn't really a need for the outer DATEADD in Scott's query, since you only need to count the distinct number of months since 1900-01-01, which is what the...
January 31, 2023 at 4:42 pm
As alternatives to the DATEADD DATEDIFF formula, you can also use the new DATETRUNC function
COUNT(DISTINCT DATETRUNC(Month, UCLogTimeStamp))
or the old conversion to a fixed-lenght char type (ISO style yyyy-mm)
COUNT(DISTINCT CAST(UCLogTimeStamp AS...
January 31, 2023 at 4:30 pm
Yeah, Excel files can be a lot of fun/pain, because an Excel sheet is essentially a bunch of Variant type cells. That makes mapping them into "normal" sql data types...
January 31, 2023 at 3:54 pm
Please see my DDL.
I would like to create:
a) Dimensional table that tracks Primary Accounts’ group movements. An account moves to different groups that are associated with levels of commission paid....
January 31, 2023 at 3:24 pm
Hi Team,
I have a requirement to track any insert/update/Delete operations happened against Database table by any user, catch those changes and send alert.
Please note that there are around 1000+...
January 31, 2023 at 2:13 pm
This is not a reseed per se, but since a TRUNCATE TABLE will restart the identity seed, you can use a temp table to store a copy of the data,...
January 23, 2023 at 7:41 pm
Viewing 15 posts - 61 through 75 (of 297 total)