Viewing 15 posts - 10,096 through 10,110 (of 15,381 total)
Wow that table needs some help. If at all possible you should consider changing that table. You should be storing datetime data in datetime instead of breaking apart all the...
November 8, 2012 at 10:31 am
The problem you are facing is known as "gaps and islands". In your case you are specifically looking for gaps. If you search this site you will find several articles...
November 8, 2012 at 9:07 am
Luis Cazares (11/8/2012)
A simple improvement on Sean solution.
;with SampleData (val) as
(
select '51079-216-20' union all
select '3456-435623-45-34'
)
SELECT REPLACE( LEFT( val, LEN( val) - 2), '-', '')
FROM SampleData
Luis that will work with two...
November 8, 2012 at 9:02 am
I will assume you didn't actually run these inserts. It is chock full of syntax errors. The dates don't have quotes around them and there appear to be lots of...
November 8, 2012 at 8:56 am
LOL Lowell you really pulled out all the stops with your T-SQL hammer on this one!!! Talk about brute force. I don't remember the link to the hammer on your...
November 8, 2012 at 8:18 am
Like this?
;with SampleData (val) as
(
select '51079-216-20' union all
select '3456-435623-45-34'
)
select left(replace(val, '-', ''), LEN(replace(val, '-', '')) - 2)
from SampleData
Please take note of how I posted sample data to make it easy...
November 8, 2012 at 8:16 am
If you want to prevent locking your table for an extended period of time you can do this in batches.
--This will ensure that the value of @@ROWCOUNT for the...
November 8, 2012 at 8:07 am
kak.mca (11/8/2012)
Worked[14 Jan][15 Jan][16 Jan]
1Emp 1Project 114/1/20107.0
2Emp 2Project 215/1/20108.0
3Emp 1Project 116/1/20108.0
From the above table:
The above table is showing like
Emp 1 has worked for 7.0 hours on Project 1 on...
November 8, 2012 at 7:50 am
I would not do this in sql. This sounds like you need a simple program to do this. If I had this assignment I would generate a .net windows service...
November 8, 2012 at 7:42 am
(Bob Brown) (11/8/2012)
This is absolutely the worse question I have encountered on QotD. Think I will pass on future Tom questions.
If this is the worst QotD you...
November 8, 2012 at 7:30 am
huestetwins (11/7/2012)
Thank you so so much, after tweaking it a bit, it works perfectly in our procedure. My developer is over the moon happy.
And the function is...
November 7, 2012 at 3:41 pm
OK I used your #mytable as the basis for this. I removed the identity from ID so the inserts would work. 😉
CREATE TABLE #mytable
(
ID INT PRIMARY KEY CLUSTERED,
summarytext varchar(max),
billid int,
);
INSERT...
November 7, 2012 at 2:31 pm
huestetwins (11/7/2012)
I'm reading the article and realize this is something that can help in our environment. I created the function and ran the query...
November 7, 2012 at 1:52 pm
sa06rdy (11/7/2012)
EDD script gives the Distinct Admission numbers from the admissions table from apr2012 to current which are satisfying the conditions given.
TEP gives the total Patients from apr2012 to...
November 7, 2012 at 1:49 pm
Thanks for the ddl. Can you post at least a couple of rows of sample data, it does not need to be real data assuming it might be sensitive. Just...
November 7, 2012 at 1:24 pm
Viewing 15 posts - 10,096 through 10,110 (of 15,381 total)