Viewing 8 posts - 31 through 38 (of 38 total)
OK, if I'd read the question a bit more carefully I would have noticed the reversed assignments.
However, I do wonder if the principal purpose of QOTD is to trick or...
September 27, 2011 at 1:40 am
Toreador (8/26/2010)
We can't easily use 'top' because it won't accept a variable, ieselect top @i...
won't work, so we'd need to use dynamic sql everywhere.
Top will accept a variable if...
August 26, 2010 at 3:32 am
It's interesting that a variable can be declared multiple times if it's within a "while" loop (provided that it's only declared once in each iteration).
When I first read the...
August 26, 2010 at 1:52 am
Dave, you're right - I should have clarified about regional settings.
But the fact remains that, whatever your regional settings, you can still use "datepart" to get next Saturday's date although...
July 30, 2010 at 2:47 am
If you are just looking for the number of Saturdays within the date range (as opposed to a list of all the Saturdays within that range) you can achieve it...
July 30, 2010 at 2:21 am
Thank you for the question. I tossed my 5-sided coin and got the right answer, then read up on endpoints.
http://www.simple-talk.com/sql/database-administration/sql-server-endpoints-soup-to-nuts/ gives a good description of endpoints.
July 27, 2010 at 1:52 am
I don't know if you consider it more elegant or not, but you can achieve the same result using patindex, eg:
declare @data table (DataValue varchar(10))
July 26, 2010 at 2:00 am
Because the AddressLine column always ends with the appartment number, this can be achieved using LEN. For example, the following code will return all appartment numbers up to 5 digits...
April 29, 2010 at 2:13 am
Viewing 8 posts - 31 through 38 (of 38 total)