Viewing 11 posts - 406 through 416 (of 416 total)
imfairozkhan (10/29/2014)
using calendar table is the only way???
Here's a quick and dirty calendar generator using a tally table (you can find plenty of example here of how to build one)....
October 30, 2014 at 9:36 am
amar_kaur16 (10/28/2014)
Since I want to keep all the historic record in table2 and...
October 29, 2014 at 4:10 pm
In case anyone thinks this example is a good idea I just want to add my vote to what Sean already suggested, namely: Never, never use SELECT * FROM a...
October 28, 2014 at 2:23 pm
select left(cast(sum(saletotal) as money) / NumberofDays, CHARINDEX('.', cast(cast(sum(saletotal) as money) / NumberofDays as varchar(max)), 1) + 2)
October 28, 2014 at 1:06 pm
selpoivre (10/26/2014)
I want such query in which i put specific IDs in IN operator and give me result which are present in table and which are not.
Will you run this...
October 27, 2014 at 5:11 pm
All right then, how about replacing the explicit string concatenation with "for xml path"?
declare @originalText varchar(7500), @includeCharacters varchar(20), @cleanText varchar(7500)
select @originalText = 'RBAR is pronounced "ree-bar" and is a "Modenism"...
October 3, 2014 at 9:59 am
Maybe I'm missing something here, but this is simple and fast:
declare @t varchar(5000) = 'RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row." This-divided-by,that|&/multiplied\by(100)give*you,%;<percent>.'
declare @s-2...
October 2, 2014 at 5:37 pm
Yikes. Methinks we've wrung a thunderstorm from a washcloth.
The point of the question was to illustrate that ISNULL (or COALESCE) do not prevent nulls when used in...
September 23, 2014 at 9:34 am
Assuming that there are ALWAYS digits to the right of the decimal, then:
select val, left(val, charindex('.', val) + 1)
from (values
('99.87'), ('99.96'), ('8.67')) sampleData(val)
If there are no digits...
September 18, 2014 at 10:01 am
Forgive my impudence, but these solutions seem rather "clever." Given the problem domain, isn't this simpler?
declare @mobile char(10), @maskChar char(1)
select @mobile = '9334457582', @maskChar...
September 17, 2014 at 10:09 am
Viewing 11 posts - 406 through 416 (of 416 total)