Forum Replies Created

Viewing 15 posts - 3,316 through 3,330 (of 4,087 total)

  • RE: pivot table summary

    PIVOT groups on every field from the inner query that is not the aggregated value or the pivoted column. That includes the TrnMonth. Try removing that from the...

  • RE: Adding a where clause in a trigger

    Your trigger is written under the assumption that there will only ever be one row inserted/updated at a time and you can't guarantee that will always be the case. ...

  • RE: Using BULK INSERT with a non delimited flat file

    I don't see any way to easily distinguish between the end of a field and the end of a record using this file format. That's going to cause problems...

  • RE: Column Alias name dynamically

    WHY? How are you planning on using these aliases? Any queries written using these aliases would be virtually impossible to read. You're better off using aliases that...

  • RE: Adding a Week number in a query.

    bitbucket-25253 (2/17/2012)


    Looking for something like this:

    DECLARE @HireDate DATETIME

    DECLARE @CurrentDate DATETIME

    SET @HireDate = '01-06-2012'

    SET @CurrentDate = GETDATE()

    SELECT DATEPART(wk, @CurrentDate) - DATEPART(wk,@HireDate) AS 'Weeks Worked'

    --Result:

    Weeks Worked

    6

    This only works if the hire...

  • RE: Execution

    A more useful statistic for comparing two queries is the number of reads. If you SET STATISTICS IO, TIME ON and then run both queries, you will be able...

  • RE: Date Format

    GuruGPrasad (2/17/2012)


    Hi kshitiz,

    But we have converted the date to format 103 then why its not formatted.

    And also when using getdate() its formatting but when we give the date its...

  • RE: Are table hints a sub-type of query hints?

    SQL Kiwi (2/16/2012)


    Rowles (2/14/2012)


    A table hint would be used in a T-SQL query. So table hints would then be a sub-type of query hint, right?

    I'm not sure I would...

  • RE: access to footer total in pivot

    T-SQL is not a reporting tool, yet you are trying to use it like one. What you are trying to do would be relatively easy in a reporting tool,...

  • RE: Label Partitioning Data based on matching attributes

    R.P.Rozema (2/15/2012)


    Combine the both solutions. Take Paul's DENSE_RANK() to generate a unique name per 'group' and add another column, using my ROW_NUMBER() suggestion to give each individual member of the...

  • RE: 2 date queries and binding togthter to one

    I agree with Sean that you'll probably want to use a calendar table.

    There are also problems with your posted code. You're trying to convert a date to nvarchar—which is...

  • RE: How to convert XML to a datatable in sql server

    There are essentially two different options: XQuery and OPENXML. There are plenty of examples in BOL and online. If you need help with a specific problem, you'll need...

  • RE: how to correct the below join query to get correct results

    There's not much we can do without sample data and expected results. Check out the following link: Forum Etiquette: How to post data/code on a forum to get...

  • RE: how to correct the below join query to get correct results

    asita (2/13/2012)


    select chl.GuaranteeCode GuaranteeCode , bal.GuaranteeCode as BalanceSheetGuaranteeCode

    from dbo.Guarantees chl

    left join dbo.Guarantees par on par.HyperionEntityId = chl.ParentHyperionEntityId

    left join dbo.Guarantees gpar on gpar.HyperionEntityId = par.ParentHyperionEntityId

    left join dbo.Guarantees ggpar on ggpar.HyperionEntityId...

  • RE: propblem in installing VS 2010

    This forum is for programming in T-SQL using the XML datatype. It is not for troubleshooting installs of third party products.

    Try this link http://lmgtfy.com/?q=error+25541+office+2010

    Drew

Viewing 15 posts - 3,316 through 3,330 (of 4,087 total)