Viewing 15 posts - 121 through 135 (of 356 total)
It depends whether or not you want to convert all the times so that they are relative to the same timezone and are therefore more easily comparable. If so, and...
May 29, 2009 at 12:04 pm
Jacob Pressures (5/14/2009)
I should have and ELSE that simply returns EmergencyRelation. But i still don't know...
May 14, 2009 at 11:43 am
This ROW_NUMBER() difference method used to solve the problem of combining sequential rows originated from the following article, or at least that's where I first saw it used.
http://www.sqlmag.com/Article/ArticleID/93606/sql_server_93606.html
Suppose we have...
May 8, 2009 at 4:23 pm
The datetime data type is stored internally as two 4-byte integers concatenated together rather than a true floating point type.
The first 4-byte integer represents the date portion of the...
May 5, 2009 at 3:11 pm
I couldn't reproduce your "joined" data when I ran the following query against your previously supplied base table data (see post on 17th April).
SELECT S.Start, S.Stop, L.PLCount
FROM dbo.LTrack L
...
May 1, 2009 at 3:55 pm
Here's an alternative method that uses CTE's. It produces the same results as Wayne's quirky update given the OP's test data.
ConsumerFK ActiveDays
33 ...
April 30, 2009 at 2:01 pm
From Books Online:
"CHECKSUM satisfies the properties of a hash function: CHECKSUM applied over any two lists of expressions returns the same value if the corresponding elements of the two lists...
April 29, 2009 at 3:45 am
Here's an alternative query that uses a method similar to Mike McQueen's to parse the times from the time strings when converted to integers. This method does have the advantage...
April 28, 2009 at 7:53 am
Zeev Kazhdan (4/27/2009)
UNION ALL
SELECT 1,6,100,1,100,15
my example will return zero duration for this Top record. This is a place to fix my explanation's mistake - in case...
April 27, 2009 at 4:53 pm
I think your problem is solvable using a HAVING clause which ensures that the number of records for each user_id that is returned is equal to the number of model_id...
April 27, 2009 at 3:50 pm
I'm not sure if the following really does what you need, but it does reproduce your expected results.
;WITH scheduled_commercials AS (
SELECT 1 AS commercial_break_id,
...
April 27, 2009 at 1:08 pm
You can't modify data in base tables from a user defined function.
If you want to reuse this TSQL you could consider putting it in a stored procedure.
April 25, 2009 at 3:05 am
By converting the time strings to datetime values, you can do the following.
/* I'm assuming here that @TimeString1 always represents the earlier time and @TimeString2 the later time */
DECLARE @TimeString1...
April 24, 2009 at 12:43 pm
You could just replace every occurrence of compdte in your query with
ISNULL(NULLIF(compdte, 0), GETDATE())
A datetime value of '1900-01-01 00:00:00.000' is 0 (zero) when the datetime is converted to...
April 21, 2009 at 11:13 am
Sorry but I still don't understand your requirements, such as which columns should be counted and which columns should be grouped / binned. Rather than making a guess as to...
April 21, 2009 at 6:09 am
Viewing 15 posts - 121 through 135 (of 356 total)