Viewing 15 posts - 61 through 75 (of 300 total)
It apparently cannot make the distinction between "temp tables" and "temporary tables". It's seriously incorrect for what most of us refer to as "temp tables" and seriously correct for...
February 7, 2023 at 6:01 pm
Sorry, but that's not valid JSON.
Generally, what most people do, is to flatten the structured JSON into one table, which can later be queried and grouped.
Alternatively you can also use...
February 7, 2023 at 5:34 pm
Dear All,
My one condition is working like if data exist than it should fail only one condition is pending that is "if data exists without qty, than qty should...
February 1, 2023 at 6:57 pm
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
Viewing 15 posts - 61 through 75 (of 300 total)