Viewing 15 posts - 106 through 120 (of 149 total)
I rewrote it yet again, without case or firstdate:
CAST (DATEADD(WEEK, ABS(( DATEDIFF(WEEK, '20161009', DATEADD(DAY, -1, o.modify_date))
+ 1 ) % 2), DATEADD(DAY, ( DATEPART(WEEKDAY, DATEADD(DAY, -1, o.modify_date))
- 7 )...
Wes
(A solid design is always preferable to a creative workaround)
October 18, 2016 at 10:25 am
rajemessage 14195 (10/16/2016)
the real situation was quite tipical, they where entering records in both tables #i and #j and
wanted to give priority to #i
because when they where entering record first...
Wes
(A solid design is always preferable to a creative workaround)
October 17, 2016 at 12:11 pm
SELECT ID ,
RTRIM(CONCAT(s.FirstName + ' ', s.MiddleName + ' ', s.LastName)) AS FullName
FROM #something AS s;
Wes
(A solid design is always preferable to a creative workaround)
October 17, 2016 at 9:19 am
ScottPletcher (10/17/2016)
Wes
(A solid design is always preferable to a creative workaround)
October 17, 2016 at 9:01 am
ScottPletcher (10/14/2016)
SELECT COUNT(*),
DATEADD(DAY,...
Wes
(A solid design is always preferable to a creative workaround)
October 17, 2016 at 8:21 am
First day of the business week is Monday.
What do you recommend?
Wes
(A solid design is always preferable to a creative workaround)
October 14, 2016 at 4:14 pm
You made me curious and its been a quiet day.
SELECT COUNT(*),
CAST(DATEADD(WEEK, DATEDIFF(WEEK, '20061231', DATEADD(DAY, 7
- CASE DATEPART(WEEKDAY, o.modify_date) WHEN 1...
Wes
(A solid design is always preferable to a creative workaround)
October 14, 2016 at 3:28 pm
ScottPletcher (10/14/2016)
Wes
(A solid design is always preferable to a creative workaround)
October 14, 2016 at 10:56 am
In case you wanted to know why Sergiy's answer is correct, your IN clause listed integer values (no quotes), even though the column is defined as a character string. ...
Wes
(A solid design is always preferable to a creative workaround)
October 13, 2016 at 2:40 pm
ScottPletcher (10/13/2016)
I don't see how that would be the case. Couldn't you just use simple math to calc the pay periods, then join to the pre-calc'd dates? How...
Wes
(A solid design is always preferable to a creative workaround)
October 13, 2016 at 1:53 pm
Another benefit to using the calendar table rather than the Select DateAdd, performance is much better when used for filtering/grouping.
One request I received at my work was to see all...
Wes
(A solid design is always preferable to a creative workaround)
October 13, 2016 at 10:15 am
Is it possible for a row to be in tblDst, but not in tblSrc? There was no mention of any action for that situation so I'm assuming you would still...
Wes
(A solid design is always preferable to a creative workaround)
October 12, 2016 at 7:19 pm
I'm curious what they mean by impact. The bridge table would be fairly light-weight and incur minimal locking. It may even be safe to use With (NoLock) to...
Wes
(A solid design is always preferable to a creative workaround)
October 12, 2016 at 5:16 pm
To check which records will not convert to float:
1. Import the spreadsheet with all columns as nvarchar(255).
2. Add a new float column to the table after populated
3. Update float column...
Wes
(A solid design is always preferable to a creative workaround)
October 12, 2016 at 3:06 pm
Create a bridge table containing a column for the primary key and a column for a left/right bit indicator.
Insert into the bridge table the exception records from each side, with...
Wes
(A solid design is always preferable to a creative workaround)
October 12, 2016 at 2:57 pm
Viewing 15 posts - 106 through 120 (of 149 total)