Viewing 15 posts - 181 through 195 (of 1,464 total)
You are on the right track.
SELECT t.Testid
, t.Status
, t.Startdate
, EndDate = DATEADD(dd,...
March 15, 2022 at 2:02 pm
Your expected output is inconsistent.
That said, I believe that you need to look at the LAG function.
March 15, 2022 at 1:36 pm
I would add a priority field and add it to the order by.
So, using Scott's code, it would now look like this ...
SELECT d.ID, ca1.Amt, ca1.AmtReason
FROM #data...
March 14, 2022 at 3:08 pm
I know nothing of JSON, but this looks like it is doingwhat you are trying to do
https://docs.microsoft.com/en-us/sql/t-sql/functions/json-modify-transact-sql?view=sql-server-ver15
March 14, 2022 at 1:27 pm
This looks like you are trying to create a catch-all query. You are on a slippery slope.
I have never worked with geometry data types before, but after a quick google,...
March 14, 2022 at 12:32 pm
Is there a difference in using an alias using the AS keyword as opposed to what you have done here for the Prev_end and Numday lines?
Functionally, there is no...
March 11, 2022 at 2:26 pm
In order to help us to help you, please provide data in readily consumable format (like this)
IF OBJECT_ID( 'TempDB..#Data', 'U' ) IS NOT NULL
DROP TABLE...
March 11, 2022 at 7:21 am
You need to GROUP BY v.PatID, v.ProcValDate
Below is an expanded data set, with options to add "RN" by both the DateTime, and just the Date
IF OBJECT_ID( 'TempDB..#value',...
March 11, 2022 at 7:08 am
You are correct in assessment of the field def....a catch all... so how in CODE based upon what I supplied can it be fixed?
Thanks.
The only way to get rid...
March 10, 2022 at 7:11 am
Thanks will do... sorry for the delays in getting this info...
What about comment: from --frederico_fonseca " you are never going to go past that error - you are converting...
March 9, 2022 at 3:10 pm
For starters, MAX ([Date_Started]), MAX([Time_Started]) needs to be modified to MAX([Date_Started]) + [Time_Started]). The actual calculation will depend on the data types of the 2 fields.
March 4, 2022 at 11:52 am
Also, be aware that UNION will be much slower that UNION ALL, as it will only return a DISTINCT result, which requires an additional sort operation
March 3, 2022 at 2:03 pm
You could find all of the columns sys.columns, but there is no way to know which ones are alligned.
So, as far as I know, you have to do it manually.
select...
March 3, 2022 at 9:24 am
As a perf update, you can use the following code for extracting Title.
C.x.value( '(title/text())[1]', 'varchar(100)' )
I am not an XML expert, but this was a tip that...
March 1, 2022 at 3:56 pm
I seem to recall a rule in place that if 3 posts for the same user are flagged as spam, the user automatically gets disabled. Is that rule still in...
March 1, 2022 at 8:55 am
Viewing 15 posts - 181 through 195 (of 1,464 total)