Viewing 15 posts - 2,971 through 2,985 (of 7,609 total)
CASE must evaluate to a single value. For this, you need to use "standard" WHERE clause and/ors:
WHERE([Admission Date] IS NOT NULL)
and
(@Parameter = 'A' and [Close...
February 5, 2019 at 12:35 pm
If I understand correctly, this is what you want:
SELECT
BCC.FirstName + ' ' + BCC.Lastname AS Matching_Name
FROM (
SELECT...
February 4, 2019 at 3:23 pm
February 4, 2019 at 12:37 pm
February 4, 2019 at 9:08 am
A shorter alternative:
SELECT [Col1],
CASE
WHEN [Col1] = '0' OR [Col1] = '200' THEN '99991231'
...
February 1, 2019 at 11:47 am
I'd strongly urge you to make this table driven rather than hard-coding any of this. If we know anything, it's that taxes always go up!
DROP...
January 31, 2019 at 3:24 pm
Might be better to just add all the calc'd columns to the underlying table, so that all queries automatically can use those columns:
...
select *
...
January 31, 2019 at 2:57 pm
That format also makes it very convenient to run a SELECT test before the UPDATE, like so:
UPDATE p
SET p.statusid = c.statusid
--SELECT /*TOP...
January 31, 2019 at 1:48 pm
Does it store the result back into a datetime variable? If so, using float to strip the time is not a problem.
January 31, 2019 at 8:20 am
This topic comes up so much, I think MS should "fudge" a little on the relational model and create a type of "char array". Then include not just selection against...
January 30, 2019 at 11:38 am
A long shot, but SSMS seems to use msdb for a lot of its actions. I've seen bloated msdbs slow down SSMS considerably, even just expanding the db list. So...
January 30, 2019 at 8:45 am
INSERT @TestTable2
(
NameRecord,
SingleName
)
SELECT ca1.*
FROM @TestTable
CROSS APPLY (
VALUES(ID, NameRecord, Name1), (ID, NameRecord, Name2), (ID, NameRecord,...
January 30, 2019 at 8:37 am
Viewing 15 posts - 2,971 through 2,985 (of 7,609 total)