Forum Replies Created

Viewing 15 posts - 3,211 through 3,225 (of 4,085 total)

  • RE: a very COMPLEX aggregation query

    dwain.c (4/19/2012)


    Drew, you said:

    After that, you should ship it off to your reporting tool to do rest. You are going to have to pivot the results to get your counts...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Tech Recruiters That Don't Understand the Tech

    GilaMonster (4/18/2012)


    That was just an example. Sub any 2008-specific feature.

    I realize it was just an example, but if there were a 2008-specific feature that was required for the job,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: a very COMPLEX aggregation query

    It looks like the first line is a grand total for Civil.

    Part of the problem is that you're using T-SQL as a reporting tool and it's not. You'd be...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Tech Recruiters That Don't Understand the Tech

    GilaMonster (4/18/2012)


    drew.allen (4/18/2012)


    How do you get the recruiter to understand that the differences between SQL 2005 and SQL 2008 are inconsequential?

    How do you know they're inconsequential for the particular job?...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Columns based on Date Range

    dwain.c (4/18/2012)


    However, this only works when the period is specifically 8 days long. If you need that period to vary, you're only recourse is to use dynamic SQL and...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: if------then ----else in select statement

    It would help if you formatted your code using the IFCode Shortcuts code="sql" so that we could more easily read your code.

    select empname ,(

    select case when empno is null...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Do not grant permission to create or modify the database objects

    You'd probably get more responses if you posted in the correct forum. There is a forum specifically for SQL Server 2008 Administration.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: T-SQL help

    I should issue a caveat on that code. It is NOT necessarily equivalent to the original query. They will produce the same results if the data includes each...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: T-SQL help

    As a note of comparison, ColdCoffee's approach requires four scans of the table and requires a total of 32 logical reads, whereas my queries only require one logical read per...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: T-SQL help

    Here's an improved version of my original query. It only scans the table once instead of twice.

    SELECT u.SourceA, u.SourceB, t.Counts

    FROM #Temp1 AS t

    CROSS APPLY(

    SELECT SourceA, SourceB

    UNION

    SELECT SourceB, SourceA

    ) AS...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to return a date in Australian date format?

    mtassin (4/16/2012)


    Ummm?

    SET DATEFORMAT DMY;

    SELECT CONVERT(VARCHAR,GETDATE(),103)

    That format has a leading zero on both the day and the month (05/04/2012). The expected results given drops the leading zero on the day,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: T-SQL help

    You're looking for a UNION, although you're duplicating a lot of your data by doing so. I'm not sure why you would want to do this.

    SELECT SourceA, SourceB, Counts

    FROM...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to return a date in Australian date format?

    Mike01 (4/16/2012)


    To avoid confusion for testing, use a day greater than 12.

    Well, I think the point is that the format drops the leading zero on days, but not months, so...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Columns based on Date Range

    Crystal Reports has a crosstab object that was specifically designed for this type of operation. It's MUCH, MUCH easier to do this Crystal than in T-SQL.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to return a date in Australian date format?

    Here are two different ways to do it.

    DECLARE @dateString DATETIME

    SET @dateString = '2012-04-05'

    SELECT @dateString,

    CASE WHEN DATEPART(DAY, @dateString) < 10

    THEN STUFF(CONVERT(varchar(10), @dateString, 103), 1, 1, '')

    ELSE CONVERT(varchar(10), @datestring, 103)

    END

    ,RIGHT(CONVERT(varchar(10), @dateString,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 3,211 through 3,225 (of 4,085 total)