Forum Replies Created

Viewing 15 posts - 8,101 through 8,115 (of 8,731 total)

  • RE: Amounts cancel out

    What happens when the positive amount won't equal the negative amount?

    Do you want a balance or just to eliminate certain amounts that won't change the calculation?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How To Prevent New Line/Carriage Return In Query Results Within SSMS

    Maybe you traveled to an alternate reality. :hehe:

    I'm glad that it's solved now (even if I didn't help). Maybe it was an issue on SSMS.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Query Help

    Just for the fun of giving more options, eventhough they might not be better than the ones previously posted.

    SELECT cStudentID,

    iSchoolYearCode,

    CASE WHEN ROW_NUMBER() OVER( PARTITION BY cGradeCode ORDER BY...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How To Prevent New Line/Carriage Return In Query Results Within SSMS

    I believe your results are being returned to text and not to grid.

    To avoid that problem you could use nested REPLACE on the columns that are giving you problems.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Recovery Model - SIMPLE V/S FULL

    Which upgrade are you talking about? :blink:

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: column with foreign keys

    That sounds like a work for the fantastic CSV Splitter.

    Read the following article: http://www.sqlservercentral.com/articles/Tally+Table/72993/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Recovery Model - SIMPLE V/S FULL

    If you're not doing any T-Log backups and you're not planning on doing them, then you should change to Simple Recovery Model. Otherwise it would be like driving a Camaro...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to find SQL Server account name ?

    You could use the SQL Server Configuration Manager

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Calculating Sales History for Months/Years

    Completely untested due to the lack of sample data, but it can give you an idea.

    DECLARE @test-2TABLE(

    TrnDatedate,

    TrnYearint,

    TrnMonthint,

    StockCodeint,

    InvoiceQty int);

    DECLARE @Date date;

    WITH CTE AS(

    SELECT DISTINCT

    TrnYear,

    TrnMonth,

    ROW_NUMBER() OVER( ORDER BY...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: triggers

    That's because you're looking for rows in tbl_warranties before they exist. That's why Lowell suggested to use the inserted table to search for the ID.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Trying to use case when to pivot data

    NineIron (6/3/2013)


    I got it now. I needed to exclude WeekOfMonthNumber and ArrivedVisits out of the group by.

    You're right, I didn't notice you had all the columns in your group by...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: selecting Distinct value in a column based on values another column.

    Would it be something like this?

    CREATE TABLE #TEST

    (

    COL1 VARCHAR(10),

    COL2 VARCHAR(20)

    )

    INSERT INTO #TEST (COL1, COL2) VALUES ('Bed+Vat', 'Vat')

    INSERT INTO #TEST (COL1, COL2) VALUES ('Bed+Vat', 'Cess')

    INSERT INTO #TEST (COL1, COL2) VALUES ('Bed+Vat',...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Trying to use case when to pivot data

    Just add a MAX to your columns.

    SELECT provider, month_name,

    MAX(case when WeekNumberOfMonth='1' then ArrivedVisits else 0 end) as 'Week1',

    MAX(case when WeekNumberOfMonth='2' then ArrivedVisits else 0 end) as 'Week2',

    MAX(case when WeekNumberOfMonth='3' then...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Case Statement in Where Clause

    This seems like a simplified catch-all queries

    http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Excel Marco - Replacing leading zero for Zip Code

    Not really the right forum to ask, but there's a format option for zip codes in the special category. Otherwise, you can use the personalized format and enter five zeros...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 8,101 through 8,115 (of 8,731 total)