Viewing 15 posts - 631 through 645 (of 7,608 total)
Hello everyone!
I am in dire need of some assistance or direction. I am by no means a expert at any of this stuff. Unfortunately for me the...
September 20, 2022 at 3:34 pm
Hello everyone!
I am in dire need of some assistance or direction. I am by no means a expert at any of this stuff. Unfortunately for me the company...
September 20, 2022 at 3:14 pm
SELECT CONVERT (decimal(9, 2) , CAST('$15,000.50' AS money))
September 20, 2022 at 3:10 pm
No need to specify the last day / number of days in the month, that can easily be calculated:
(CASE WHEN MONTH = @month AND DAY = @day...
September 20, 2022 at 2:26 pm
I agree. In fact, any book on T-SQL by Ben-Gan will be worth studying.
September 15, 2022 at 2:52 pm
You might find it easier to reason about with EXCEPT and INTERCECT.
SELECT DISTINCT KEY FROM myTable WHERE type = 'COLL' and subtype = 'MOD'
EXCEPT
SELECT DISTINCT KEY...
September 14, 2022 at 9:26 pm
Yes. If you only want a key that has both conditions, change the MAX:
MAX(CASE WHEN type = 'QUAT' AND subtype = 'BALANCE' THEN 1 ELSE 0 END) = 1
Note that...
September 14, 2022 at 8:46 pm
SELECT key
FROM dbo.your_table_name_here
GROUP BY key
HAVING MAX(CASE WHEN type = 'COLL' AND subtype = 'MOD' THEN 1 ELSE 0 END) = 1 AND
MAX(CASE WHEN...
September 14, 2022 at 7:46 pm
I don't think so. PIVOT works on only one column at a time, IIRC. A cross-tab is almost certainly the best method here.
September 14, 2022 at 7:12 pm
Great point; sorry, I accidentally left out that "current year" requirement.
September 14, 2022 at 2:22 pm
If you just want the MemberID, then as below. Of course you can adjust the query against the cte to pull more columns if you want them. Either way, I...
September 13, 2022 at 11:12 pm
You want the unique clustered index on ( date_, ID_vard ), assuming that you do primarily query the table by date_, and not on just ID_vard.
Can you clarify...
September 13, 2022 at 4:08 pm
You want the unique clustered index on ( date_, ID_vard ), assuming that you do primarily query the table by date_, and not on just ID_vard.
September 13, 2022 at 2:48 pm
You likely should encode the room name for internal use -- I'd probably call it "room_code" -- but you'll need at least a smallint, and I'd probably just "byte" the...
September 12, 2022 at 8:04 pm
I am going to add this statement at the top of the SP, it will prevent or minimize deadlocks:
SET DEADLOCK_PRIORITY HIGH
No, it won't. Instead, it will force SQL to kill...
September 12, 2022 at 7:51 pm
Viewing 15 posts - 631 through 645 (of 7,608 total)