Viewing 15 posts - 1,111 through 1,125 (of 1,464 total)
May 9, 2017 at 8:43 am
May 8, 2017 at 10:09 pm
I'm trying to normalize my data to hours and I'm a bit confused.
For example, for...
May 8, 2017 at 3:48 pm
You can also use the OUTPUT clause to populate the "audit/history" table
CREATE TABLE #Table (
SomeInt INT NOT NULL
, SomeString VARCHAR(20)...
May 7, 2017 at 11:42 pm
Nice Chris
Just one small change to your script
Need to change MIN(ENDDATE) to MAX(ENDDATE)
SELECT ACCOUNT, PROGRAM, STARTDATE = MIN(STARTDATE), ENDDATE = MAX(ENDDATE)
FROM (
...
May 7, 2017 at 2:57 am
After re-reading my post from last night, I notice that the solution will only work if STARTTIME is always unique.
Below is a modified query that will handle multiple ACCOUNT,...
May 6, 2017 at 12:47 am
This is a classic Islands problem - You can Google for "SQL Gaps and Islands" for other examples
Test Data
CREATE TABLE #TEMP(ACCOUNT VARCHAR(15),STAFF VARCHAR(10),PROGRAM VARCHAR(10),STARTDATE...
May 5, 2017 at 4:45 pm
SELECT COL1, COL2, VALUE AS [NEW_COLUMN]
FROM TABLE AS p
UNPIVOT (
VALUE FOR COL IN ([COL3],[COL4],[COL5],[COL6])
) AS up
May 5, 2017 at 3:52 pm
The following code in a separate file per table, means that the entire file is deployed each time there is a change. It is also re-runnable.
If there is...
May 5, 2017 at 8:55 am
Use EXCEPT to find the mismatched.
UNPIVOT those rows, and Use EXCEPT again.
May 4, 2017 at 1:38 pm
Create a trigger that updates the value of confirmDate
May 3, 2017 at 11:24 pm
May 3, 2017 at 8:27 am
Stuart Davies - Wednesday, May 3, 2017 12:45 AMSpace
Odyssey
May 3, 2017 at 1:06 am
ManicStar - Tuesday, May 2, 2017 7:03 AMWaiting
Lady (in)
May 2, 2017 at 11:17 am
Viewing 15 posts - 1,111 through 1,125 (of 1,464 total)