Forum Replies Created

Viewing 15 posts - 4,066 through 4,080 (of 4,085 total)

  • RE: Filtering WHERE on a field not in the DB

    ps (7/29/2009)


    select colA, colB, colC, colD=colA+colB+ colC from mytable where colD=123

    I recommend that you TEST your solutions before posting, even for something apparently this simple. It helps no one...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Will IS NULL work for IF criteria

    Iron Chef SQL (7/29/2009)


    for some reason my if condition (to test if NULL then INSERT) inserts data no matter what.

    I'm trying to figure out why but maybe it's something simple...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: left outer join needed?

    gyessql (7/29/2009)


    If I dont want any fields from table2 then left join doesn't make a difference here, right?

    Wrong. If the tables are in a one-to-one relationship then a left...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Will IS NULL work for IF criteria

    Why don't you use

    IF Not Exists (

    SELECT ct

    FROM ironchef.dbo.war_conferenceregistrations

    WHERE eventmeetingsetupid = @eventmeetingsetupid

    )

    This has the advantage that it will...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Need help in a sub query

    Providing enough information is key to getting the help you're requesting. Check out this article http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: error message capturing and sending them to email

    Carefully reread Jack's response and you'll find the answer to your other question.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Simple 'WHERE' clause question

    Because SQL doesn't process the statements from the top to bottom. Check out this website for more information http://blog.sqlauthority.com/2009/04/06/sql-server-logical-query-processing-phases-order-of-statement-execution/. The WHERE clause is processed before the SELECT clause,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: T-sql search condition

    I was thinking something similar, but I would add a Having clause like HAVING Min(IsNull(Column_Name,'') 'creation_date' OR Max(IsNull(Column_Name, '') 'last_modified_date' You may also want to specify the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: datetime conversion

    Another option SELECT Convert(Datetime, Replace('20Jul 15:46:1', ' ', '2009 '))

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Joining two blocks of code

    First, you really should simplify your code. I struggled through what you were trying to accomplish with your statement. I figured out that this section CONVERT(DATETIME,STR(YEAR(CreateDate))+'-'+STR(MONTH(CreateDate))+'-'+STR(DAY(CreateDate))

    +' '+STR(DATEPART(HOUR,CreateDate))+':'+STR(DATEPART(MINUTE,CreateDate))+

    ':'+STR(DATEPART(SECOND,CreateDate))) serves...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: isdate priority

    Well, you could use a CASE statement or a UDF, but you would need to use it in both your SELECT clause and the WHERE clause. Otherwise you're going...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Expressions in SSIS - help needed with datetime

    You need to use the IIF(<Logical Expression>, <True Part>, <False Part>).

    Also, I think that your false part can be greatly simplified by using the DateAdd() function. Try the following...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to generate a sequence for a particular group of rows in SSIS

    I did a Google search and quickly came up with a number of web pages that tell you how to do this. There is a third-party transformation, but that...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Case function is not working in PIVOT

    Your CASE statement is fine. The problem is in your PIVOT statement. You have PIVOT

    (

    MAX(fldTCN)

    FOR fldTCN IN ([1.1],[2.2],[3.3],[4.4])

    ) AS Pvt

    This gives you the max of the field that...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: MDX to calcluate weekday AVGs

    I'm still learning MDX myself, so I'm not sure I can explain why it is necessary. I knew that you shouldn't be getting the exact same average for each...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 4,066 through 4,080 (of 4,085 total)