Viewing 15 posts - 1,306 through 1,320 (of 3,957 total)
p.avinash689 (10/13/2013)
October 13, 2013 at 7:03 pm
Without DDL and consumable sample data I won't venture a coded solution.
I do recommend that you look into the SQL 2012 LAG function: http://technet.microsoft.com/en-us/library/hh231256.aspx
October 13, 2013 at 6:56 pm
I'd say start with this and decide what type_desc you need to check:
SELECT name, object_id, type_desc, create_date, modify_date
FROM sys.objects;
October 13, 2013 at 6:47 pm
Not that it means much until you upgrade, but you may want to consider avoiding these 2 because they seem to fail in SQL 2012 using Cadavre's test harness:
SELECT DATEADD(dd,...
October 13, 2013 at 6:38 pm
easy_goer (10/13/2013)
October 13, 2013 at 6:20 pm
That looks like my query but I don't see any results attached.
BTW. There is the possibility that mine might not return what you expect if your base query returns...
October 11, 2013 at 3:32 am
james.ingamells (10/11/2013)
I did have a go at your attempt, however if I want to be able to use this on a monthly basis i would have to do the...
October 11, 2013 at 2:10 am
Looks like homework, but if what you're after is the Names associated with columns A and B, perhaps a correlated sub-query would be best:
CREATE TABLE #Table1
(A CHAR(2), B CHAR(2),...
October 10, 2013 at 10:07 pm
Firstly, in a query as follows there is no need for the second DISTINCT:
select distinct * from table1 where column1 in (select distinct column1 from table 1).
Secondly, you may be...
October 10, 2013 at 7:21 pm
Sean - Love your cheat!
Another way:
SELECT DATEADD(minute, DATEDIFF(minute, '00:00', @TheTime), @DateTime)
October 10, 2013 at 7:09 pm
Why don't you post the DDL you have created so far?
October 10, 2013 at 7:02 pm
If you look at the fourth article in my signature links, therein lies a tool that I think is the Swiss army knife of all string handling functions. It...
October 10, 2013 at 6:38 pm
james.ingamells (10/10/2013)
THanks Jack,It now runs, but does not pull the zero values i was hoping for. Do i need to join a calendar table on to it?
Guess you didn't like...
October 10, 2013 at 6:11 pm
Some might prefer in-line Tally tables.
DECLARE @start_date DATE = '1990-01-01';
DECLARE @rows INT = 6000;
WITH Tally (n) AS
(
SELECT 0 UNION ALL
SELECT TOP...
October 9, 2013 at 11:55 pm
LinksUp (10/9/2013)
I really liked the Grouping because is was so straightforward. Why didn't I think of grouping! (Duh!)
Of course nothing beats a cte except a...
October 9, 2013 at 11:32 pm
Viewing 15 posts - 1,306 through 1,320 (of 3,957 total)