Viewing 15 posts - 2,071 through 2,085 (of 3,957 total)
A recursive CTE approach does appear to be the way to go for this. Perhaps this one is a little simpler to understand.
DECLARE @table1 TABLE(component VARCHAR(10), bin INT, prd...
January 28, 2013 at 11:37 pm
Sorry! Strike that. The solution I posted didn't work quite as advertised.
January 28, 2013 at 7:53 pm
CapnHector (1/28/2013)
dwain.c (1/27/2013)
CREATE TABLE #Guests (checkin date, checkout date, FullName varchar(50))
INSERT INTO #Guests
SELECT '10/12/2012', '10/16/2012', 'Corky Doe' UNION ALL
SELECT '12/12/2012', '12/17/2012',...
January 28, 2013 at 6:55 pm
Jeff Moden (1/28/2013)
Just say "NO" to the mind drug known as "loops" in T-SQL. 😉
I do!! 😀
January 28, 2013 at 6:54 pm
ChrisM@Work (1/28/2013)
January 28, 2013 at 6:46 pm
Mvs2k11 (1/28/2013)
How do i convert the below date fromMon Jan 28 11:03:06 EST 2013
To
2013-01-28 11:03:06
Thanks for your help in advance
If the string contains EST, does that mean other strings might...
January 28, 2013 at 5:27 pm
Hers's another way.
declare @transactions as table (Receivers char(1), Payers char(1))
insert into @transactions(Receivers, Payers)
values('A' , 'A')
,('B' , 'A')
,('A' , 'B')
,('A' , 'D')
,('B' , 'D')
,('C' , 'A')
,('B' , 'E')
,('A' , 'E')
SELECT RecPyr
FROM...
January 27, 2013 at 8:59 pm
Steven,
Not sure why you used all of those yukky loops (reference my mantra):
IF OBJECT_ID('tempdb..#Years') IS NOT NULL
DROP TABLE #Years
--a table to hold the sample data
CREATE TABLE #Years (
...
January 27, 2013 at 8:46 pm
I think you need a calendar table to do this:
CREATE TABLE #Guests (checkin date, checkout date, FullName varchar(50))
INSERT INTO #Guests
SELECT '10/12/2012', '10/16/2012', 'Corky Doe' UNION ALL
SELECT '12/12/2012', '12/17/2012', 'Janice Doe'...
January 27, 2013 at 8:17 pm
wendy elizabeth (1/27/2013)
January 27, 2013 at 7:29 pm
vinu512 (1/25/2013)
Dwain, your query is the clear winner. Here are the results for all the three queries :...
January 25, 2013 at 3:56 am
Eugene Elutin (1/24/2013)
leesider (1/24/2013)
January 25, 2013 at 1:21 am
mike 57299 (1/24/2013)
January 24, 2013 at 11:01 pm
Since a trigger is just a special kind of SP, I believe you could.
Better though if you kept the code in the trigger rather than reaching out to another one,...
January 24, 2013 at 10:42 pm
I am no oenophile but...
Perhaps something like this will get you on track?
;WITH InBBLS AS (
SELECT *
...
January 24, 2013 at 9:16 pm
Viewing 15 posts - 2,071 through 2,085 (of 3,957 total)