Forum Replies Created

Viewing 15 posts - 661 through 675 (of 2,452 total)

  • RE: How to find postcodes with two spaces in the middle?

    still not sure what are after....thanks for the sample data, would be good if you posted expected results based on that sample..

    maybe...??

    select REPLACE(p_code,' ',' ') pcode

    from Postcode

    where

    patindex('[A-Z][0-9] ...

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

  • RE: Compare 3 tables and calculate working days

    ganapathy.arvindan (5/24/2016)


    Code is not clear here..mostly the output sample is not in clear format

    when you post you will see at the lefthand side there is list of "IFCode Shortcuts" ...

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

  • RE: Compare 3 tables and calculate working days

    you are more likely to get a respone if you post your question here, along with scripts that create tables, insert sample data and the results you expect from...

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

  • RE: Record Matching FIFO to ignore any sale transaction before a buy or no inventory

    b ghanekar (5/18/2016)


    Sorry sir I am not clear about table script? Can you tell me further please. Thanks for bearing me so long.

    The output from your data should be as...

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

  • RE: I need to create a value when one item is daily and the other item is only monthly

    when you post you will see at the lefthand side there is list of "IFCode Shortcuts" such as code=sql - /code (in square brackets) ..... if you...

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

  • RE: I need to create a value when one item is daily and the other item is only monthly

    randyetheridge (5/20/2016)


    did you open the attached word document? It gives a detailed example of the output file. someone gave me instructions on how to post the output, using...

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

  • RE: I need to create a value when one item is daily and the other item is only monthly

    how are you calculating these results....are they supposed to be averages over the period?...or some other process?

    End Result

    FromDateToDate CADRate USDRateCADExchangeRate

    3/31/20164/29/201667.851887.757877.3171

    2/29/20163/30/201667.718688.323676.6710

    1/31/20162/28/201665.091590.719471.7504

    12/31/20151/30/201566.155191.575172.2414

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

  • RE: Pivot for date

    gave you some dynamic pivot code last week.....can you make use of that?

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

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

  • RE: Assigning max value + 1 to a column

    yahya-236450 (5/19/2016)


    Hi

    First time they would all be null then we start with Invoice No = 1 for first row that falls under the criteria when the query is run and...

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

  • RE: Assigning max value + 1 to a column

    bit confused...are you saying that initially every row in Orders table has the InvoiceNo as 'NULL' and then based on a specifc WHERE clause you want an incrementing number?

    eg

    WHERE ...

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

  • RE: Time card Hours calculation

    J Livingston SQL (5/19/2016)


    navya8877 (5/19/2016)


    Thank a Ton for solving this. This looks perfect. 🙂

    have you tested with more than one employee?

    INSERT INTO @TimeCard

    VALUES

    (5, 6665157, 468, 'ENTER', '2016-05-17 08:13:43.000'),

    (5, 6665157, 468,...

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

  • RE: Time card Hours calculation

    navya8877 (5/19/2016)


    Thank a Ton for solving this. This looks perfect. 🙂

    have you tested with more than one employee?

    INSERT INTO @TimeCard

    VALUES

    (5, 6665157, 468, 'ENTER', '2016-05-17 08:13:43.000'),

    (5, 6665157, 468, 'EXITS', '2016-05-17 12:14:49.000'),

    (5,...

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

  • RE: Record Matching FIFO to ignore any sale transaction before a buy or no inventory

    b ghanekar (5/18/2016)


    Thanks for your reply.

    Buy Transactions

    'M33945','A01022','2011-06-15',3

    'M33945','A01022','2011-06-16',5

    'M33945','A01022','2011-06-20 ,5

    'M33945','A01022','2011-06-22 ,5

    Sale Transactions

    'M33945','A01022','2011-06-17’,2,'Y'

    'M33945','A01022','2011-06-17',4,'Y'

    'M33945','A01022','2011-06-17',1,'Y'

    'M33945','A01022','2011-06-18',3,'Y'

    'M33945','A01022','2013-01-30',5,'Y'

    Output desired

    M33945, A01022, 2011-06-15, 3, 2011-06-17, 3 N

    M33945, A01022, 2011-06-16, 4, 2011-06-17, 4 N

    M33945, A01022, 2011-06-16, 1, 2011-06-18, 1...

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

  • RE: Are the posted questions getting worse?

    Lynn Pettis (5/18/2016)


    J Livingston SQL (5/18/2016)


    Lynn Pettis (5/18/2016)


    Grumpy DBA (5/18/2016)


    jasona.work (5/18/2016)


    Brandie Tarvin (5/18/2016)


    Oh, my. SS just rebuked someone for asking what SS thinks is an irrelevant question. And in this...

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

  • RE: Are the posted questions getting worse?

    Lynn Pettis (5/18/2016)


    Grumpy DBA (5/18/2016)


    jasona.work (5/18/2016)


    Brandie Tarvin (5/18/2016)


    Oh, my. SS just rebuked someone for asking what SS thinks is an irrelevant question. And in this case it probably is, but...

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

Viewing 15 posts - 661 through 675 (of 2,452 total)