Forum Replies Created

Viewing 15 posts - 871 through 885 (of 2,452 total)

  • RE: Sql Results to appear on 1 Row

    as a suggestion...please refer to your similar question below (2 years ago)

    http://www.sqlservercentral.com/Forums/FindPost1549885.aspx

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Sql Results to appear on 1 Row

    why do you need to do this?

    if you had 20 people involved in a project, then that would create 40 columns......who/what is going to use this output?

    edit: typo

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Sequence and Pivot based on pattern or islands

    just to give you an idea...here's some sample data and a view using productcode as char

    --generate a test table

    use tempdb

    go

    --DROP TABLE test;

    --DROP TABLE #gen1;

    --DROP TABLE #gen2;

    --DROP VIEW testview;

    SELECT TOP...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Sequence and Pivot based on pattern or islands

    richardm 53436 (3/11/2016)


    Thanks for the replies!

    I tried J Livingston first CTE method and while that worked perfect on the dataset provided I didn't realise the datatype of the Headerproductcode...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Sequence and Pivot based on pattern or islands

    sgmunson (3/10/2016)


    I don't have a 2012 instance handy, or I could have tried using LEAD or LAG with some GROUP BYs, but here's a query that only uses 2008 syntax...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Sequence and Pivot based on pattern or islands

    one idea....???

    WITH cte as (

    SELECT OrderNo,

    OrderLine,

    CASE WHEN part = 'H' THEN productcode ELSE NULL END as...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: please help to convert column to row in sql

    does the relate to your previous question

    http://www.sqlservercentral.com/Forums/FindPost1767204.aspx

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Audit Trigger firing twice

    see this thread....the trigger is "almost" like yours...

    towards the end of the thread I posted some test scripts.

    I have used this trigger....but only on tables where the data is infrequently...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: LAst date's for past 3 months

    sharonsql2013 (2/23/2016)


    How can I show last days for past 3 months say..

    Jan 2016 (2016-01-31 23:59:59.000)

    , Dec 2015

    and Nov. 2015

    Need to be dynamic as it will change with...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Date difff from two dates divide by count

    djreggaestyles (2/13/2016)


    cool thx for your help, i am going to try something else but your suggestion did help

    fair enough...would appreciate seeing what else you try and how you get on...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Date difff from two dates divide by count

    ok...a starter to build upon

    maybe this is what you require or maybe not.

    please note......it would be helpful to post set up scripts and expected answers when you start a new...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Date difff from two dates divide by count

    djreggaestyles (2/13/2016)


    PS its not home works

    so what have tried so far......what isnt working?

    here are some pointers....

    GROUP BY

    DATEDIFF

    COUNT

    ....I am far happier helping someone who has tried, rather than someone who just...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: How do we get the definition of tables via sql

    Jeff Moden (2/13/2016)


    mw112009 (2/12/2016)


    Jeff M

    What we need is to be able to do via T-SQL and also we need to get the def for all tables ( Not just picking...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Date difff from two dates divide by count

    here is some sample script to set up your data....you should always provide when asking questions such as this.

    it helps us help you.

    CREATE TABLE #yourtable(

    insurer ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Date difff from two dates divide by count

    are the start_date end_date ALWAYS the same same for each unique claim

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 871 through 885 (of 2,452 total)