Viewing 15 posts - 496 through 510 (of 1,464 total)
Why are your seconds stored as strings? Convert them to integers, then this should do the trick.
SELECT *, [HH-MM-SS] = CAST(DATEADD(SECOND, l.Seconds, 0) AS time(0))
FROM ...
August 20, 2019 at 10:11 am
Sory @province is not 2 chars it's 1 char. That's the business rule i was asked to do so. 1 char from province 7 chars from Country with seq...
August 16, 2019 at 2:21 pm
You can create a tracking table and use a Quirky Update in a proc to do this
CREATE TABLE dbo.CountryProvNumber (
Country ...
August 16, 2019 at 1:58 pm
ok I understand that. And I think the end users would like that. the table would give them easier visibility to the rollups.
Let me work on that.
For performance reasons,...
August 12, 2019 at 3:08 pm
First just to be clear I am not a developer. I am just an accountant who knows enough SQL to get myself into these predicaments 🙂 So please be...
August 12, 2019 at 2:08 pm
You can add GROUP BY to Piet's code to ensure that you get distinct data for each EID and BID. Also change the 3rd parameter of STUFF from 1 to...
August 10, 2019 at 6:01 am
are you looking for this?
update #a
set a = case
when a = 0 then NULL
else a
end,
b = case
when b = 0 then...
August 6, 2019 at 3:30 pm
So here is a quick sample of how the DELETE can have unexpected results.
First, the data to work with
IF OBJECT_ID(N'tempdb..#DestTable', N'U') IS NOT NULL
BEGIN
DROP TABLE...
August 5, 2019 at 7:19 pm
I haven't used the MERGE statement since I got burned many years ago doing a
WHEN NOT MATCHED BY SOURCE THEN DELETE
As it turns out, you end up...
August 5, 2019 at 12:49 pm
DesNorton,
You mentioned:
The N'xxx' is an indicator that the contents between the quotes is unicode (which is what the function is expecting). The N'U' does in...
August 4, 2019 at 4:49 am
DesNorton,
I see what you are saying now. I was reading it wrong. But what about my second post where SQL says 'CK_isActive' is not a constraint? I...
August 2, 2019 at 4:26 am
DesNorton,
I see what you are saying now. I was reading it wrong. But what about my second post where SQL says 'CK_isActive' is not a constraint? I don't understand...
August 1, 2019 at 4:34 am
Remove the where clause. then it does all products
July 31, 2019 at 12:03 pm
This is a simple SUM with GROUP BY
SELECT t.BoughtDate
, Apples = SUM( t.BoughtApples )
...
July 31, 2019 at 6:28 am
Edit: I ran this part of the code only to see if I can isolate the problem:
ALTER TABLE Costpoint.ProjectCodes
DROP CONSTRAINT CK_isActive;
and I got this error message:
July 31, 2019 at 6:15 am
Viewing 15 posts - 496 through 510 (of 1,464 total)