Viewing 15 posts - 106 through 120 (of 1,468 total)
As stated in the other thread, download and install the following function in your DB
CREATE_FUNCTION_dbo_DelimitedSplit8K_LEAD.sql
Then use it as follows
WITH cteTwoWords AS (
SELECT TwoWords =...
May 4, 2023 at 10:36 am
This was the error message
Msg 208, Level 16, State 1, Line 14 Invalid object name 'dbo.DelimitedSplit8K'
Did you download and install dbo.DelimitedSplit8K on your SQL instance?
May 4, 2023 at 10:32 am
If you are using an earlier version of SQL, then I suggest that you read Tally OH! An Improved SQL 8K “CSV Splitter” Function by Jeff Moden. ...
May 4, 2023 at 6:44 am
As ratbak indicated, you have posted in a SQL 2022 forum. As such, my proposed solution uses functionality that is available in SQL 2022.
If you are using SQL 2012 to...
May 4, 2023 at 6:39 am
We cannot dump an image of your data in SSMS to test any code.
So, I made up some dummy data for myself.
The following code appears to do what you are...
May 3, 2023 at 1:43 pm
If I run your code against your sample data, i get RuningTotal = 1.0000
April 18, 2023 at 9:48 am
FYI, in your RunningTotal, you want to frame the query by including a Rows clause
ORDER BY a.datalc, a.cm ASC
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
April 18, 2023 at 7:24 am
It would appear that you have different ORDER BY clauses for your RunningTotal vs RowNum and LastPCM fields. This will impact the outcome.
April 18, 2023 at 7:13 am
Are
FUNCTION1
,
FUNCTION2
, etc, all user-defined scalar functions?
No, there are no functions in the code. Those are simply SQL Sentry Plan Explorer getting creative with its anonymisation of the code.
March 1, 2023 at 3:18 pm
Here is a list of Some Common Date Routines by Lynn Pettis
If you are using SQL2022, you can use the DATETRUNC function for these kind of calculations.
February 3, 2023 at 11:52 am
This proc takes the current datetime and does a whole lot of unnecessary calculations to reduce it to 01-JAN-1900
You execute this proc as follows
DECLARE @ResultDate datetime;
EXEC dbo.smGetMinDate...
February 3, 2023 at 6:59 am
What is the data type of DH.OPENING_HOUR_H?
Please provide samples of the data in the field
January 29, 2023 at 8:30 am
The following SQL solution should get you there
DECLARE @ReportDate date = '2022-06-05';
DECLARE @ReportMonths int = 6; -- This value will be the number of months...
January 10, 2023 at 3:30 pm
You can always use EXCEPT
SELECT ID1 FROM A1
EXCEPT
SELECT ID2 FROM A2
December 19, 2022 at 7:25 am
I would rather use
WHERE CAST(date AS TIME) >= '00:00:00'
AND CAST(date AS TIME) < '06:00:00'
December 13, 2022 at 7:43 pm
Viewing 15 posts - 106 through 120 (of 1,468 total)