Forum Replies Created

Viewing 15 posts - 4,036 through 4,050 (of 4,075 total)

  • RE: How to ORDER BY calculated/computed field ?

    I don't think it's necessary to use both a CTE and a derived table here. The following is untested, but should work.

    WITH SQLPaging AS (

    SELECT...

  • RE: Sometimes get IndexScan instead of IndexSeek

    How about an EXCEPT?

    SELECT t1.col1

    FROM T1

    EXCEPT

    SELECT t2.FkCol

    FROM T2

    Drew

  • RE: Calculating custom score

    There are two variants of the CASE statement

    CASE <Expression>

    WHEN <Value Expression> THEN <Result Expression>

    or you can use

    CASE

    WHEN <Boolean Expression> THEN <Result Expression>

    You...

  • RE: Date comparison help

    lduvall (8/3/2009)


    I want to pull records for sessions two weeks prior to their start date and I want to continue pulling them until two weeks after their end date. I'm...

  • RE: Curly question I can't work out without cursors!

    ta.bu.shi.da.yu (8/3/2009)


    I'm thinking that I'll just use a cursor or a while loop. I was thinking of running the query as the select statement in the cursor, then find the...

  • RE: Date conversion

    Jeff Moden (8/2/2009)


    Does SSRS have something in it to take an SQL DateTime and format it for display without disturbing the sortability of the underlying SQL DateTime?

    If all else...

  • RE: Date conversion

    Tejas Shah (8/1/2009)


    Its better to use DATEADD(dd,0, DATEDIFF(dd,0,GETDATE())) instead of the conversion.

    If the datepart you're using is Days, then the order does not matter, but if you are using any...

  • RE: How to reuse a Task?

    itzfake (7/31/2009)


    I have 3 tasks with success constraint link executed in the following order :

    Script Task 1 -> Script Task 2 -> Email Script Task

    If Task 1 and...

  • RE: Calculating margin in group by

    A pivot table in what software? Excel?

    You need to code the margin as a calculated member in your pivot table software, not in SQL.

    Drew

  • RE: find missing records only

    I realized what I was missing when I first approached this problem. You have to get a result for every single combination of account ID and required header. ...

  • RE: find missing records only

    First, why does your #header table have a duplicate ID? The purpose of an ID field is to uniquely identify a particular record. Your headerID with a value...

  • RE: Row distribution to rows from another table

    This approach should work, but it is UNTESTED. It divides the clients evenly, but, and this is a big but, it does not retain the order.

    1) Create a...

  • RE: Calculating margin in group by

    I'm not sure how your margin is calculated, but it sounds like you have an issue with a semi-additive or non-additive aggregation. For instance, if you have a formula...

  • RE: t-sql help, urgent please!!

    It's not necessarily pretty, but this will work. Convert the datetime to a string in Canonical ODBC format (20 or 120), but truncate the string at the first digit...

  • RE: Help with company budgets dataset...

    First off, I would recommend to anyone posting sample data that includes dates to put the dates in 'yyyy-mm-dd' format. That format is unambiguous whereas the formats 'dd/mm/yyyy' and...

Viewing 15 posts - 4,036 through 4,050 (of 4,075 total)