Viewing 15 posts - 1,396 through 1,410 (of 13,838 total)
Doing it this way may help. It assumes that twdatum is a datetime column and that there is a suitable index in place (eg, on (twdatum, asis)).
DECLARE...
May 12, 2022 at 9:14 am
Try changing ELSE 0 to ELSE NULL.
Otherwise you are just counting zeros rather than ones, which explains the behaviour you are seeing.
May 12, 2022 at 7:42 am
@phil parkin this doesn't even run. no errors or anything it just will not execute
Runs fine for me. Maybe now you appreciate that different flavours of SQL have their...
May 11, 2022 at 11:25 pm
Here's another version.
DROP TABLE IF EXISTS #t;
CREATE TABLE #t
(
Part INT NOT NULL
,lowest_cost DECIMAL(19, 6) NOT NULL
,date_received DATE...
May 11, 2022 at 6:00 pm
Thank You Phil - Sorry for the late reply - Input Data Type is varchar and the max precision is 4.
No worries. Scott's solution should work for you.
May 11, 2022 at 3:35 pm
I have not taken the time to analyse your code, but I would suggest leaving the pivoting to SSRS. If you can get results in the form
Username, DBName, Roles
(where Roles...
May 11, 2022 at 8:03 am
I often use this site when looking at JSON strings. I pasted your J1 version into it and, as you will see from the image below, it is perfectly...
May 11, 2022 at 7:59 am
What is the datatype of the Input variable? If numeric, the values 1.1, 1.10 and 1.100 are indistinguishable.
May 10, 2022 at 3:54 pm
Your final WHERE clause makes no sense:
WHERE BusinessEntityID >= @BusinessEntityId AND BusinessEntityID <= @BusinessEntityId;
This is equivalent to
WHERE BusinessEntityID = @BusinessEntityId
Is that what you meant?
May 10, 2022 at 3:37 pm
As you're on 2019, use the TRIM() function instead. Do the trim first.
LEFT(TRIM())
May 10, 2022 at 2:43 pm
If this works, it's a bit simpler. Can't remember how SSIS handles NULL values in expressions like this, so might not work.
replace(FirstName + " " + ...
May 9, 2022 at 12:57 pm
Hashing is a one-way process ... you can't get back to the original value if you know only its hashed value.
May 9, 2022 at 12:26 pm
Thanks for the reply, Phil! I think I could handle a simple query like that as well. Where it starts getting rough for me is when there are [x]...
May 5, 2022 at 3:55 pm
What is the datatype of the column 'status_count'?
We have assumed that it is an integer, but I suspect that it is not.
varchar cause there are letter in it ...
May 5, 2022 at 10:04 am
Viewing 15 posts - 1,396 through 1,410 (of 13,838 total)