Viewing 15 posts - 2,596 through 2,610 (of 4,081 total)
You can also get it done with a LIKE in your where clause if you read up on the various wildcard patterns. But if you restrict it to an...
August 20, 2009 at 11:11 am
declare @input varchar(100)
set @input = '000100010001'
;with tally (N) as (select row_number() over (order by id) from master..syscolumns)
select N from tally
where substring(@input,N,1) = '1'
and N <= len(@input)
edited to...
August 20, 2009 at 10:43 am
Hey J-F,
Your subquery solution is cleaner in that it avoids the uneccessary join to the item table to find the unwanted ItemIDs. The CTE solution should be...
August 19, 2009 at 3:04 pm
Thanks for posting the sample data!!! It made my job MUCH simpler. 🙂
The following solution uses explicit JOINS because your use of the WHERE clause with a...
August 19, 2009 at 2:51 pm
Use CONVERT, because CAST doesn't give you all the formatting options.
The new datatypes aren't necessary unless you want to disregard time or store really ancient dates. But you...
August 19, 2009 at 2:31 pm
The internal storage of date and datetime information is actually an integer datatype, not a character string. However, it is presented as character string when you do a...
August 19, 2009 at 2:18 pm
Still don't see why what you have isn't working. But I do see that you are using a while loop in your parse function. ...
August 19, 2009 at 2:11 pm
While waiting on the parsestring function to be posted, I will also ask if you have considered rewriting it as a parse to produce a derived table to feed the...
August 19, 2009 at 1:28 pm
Awwww... that's not true... I've got a couple thousand... errr dozen at most.
August 19, 2009 at 1:07 pm
Hey Michelle 🙂
If you didn't already know, Lynn is renowned for his patience to the point that he has often been called Saint Lynn by the regulars at SSC....
August 19, 2009 at 11:49 am
Glad you like it, Lynn.
Steve: Suggestion for new functionality... name/avatar history. 😀
August 19, 2009 at 11:28 am
Humor is subjective. In some people's cases, it needs to be subjected to a baseball bat.
Hey! I resemble that remark!
August 19, 2009 at 11:03 am
With the column changes in place, this works.
declare @sample table (eligMonth dateTime, membID int)
insert into @sample
select '2009-07-01', 899931100 union all
select '2009-07-01', 899931700 union all
select '2009-07-01', 899931000...
August 18, 2009 at 1:21 pm
You are right of course that it would be nice to have some sample data from the author of the question. For example, we don't know if a...
August 18, 2009 at 12:52 pm
If a member can appear multiple times with multiple eligibility dates, and you are ONLY concerned about the current month and the previous month, then
declare @sample table (member int,...
August 18, 2009 at 12:48 pm
Viewing 15 posts - 2,596 through 2,610 (of 4,081 total)