Forum Replies Created

Viewing 15 posts - 6,781 through 6,795 (of 8,731 total)

  • RE: One Row with all the results

    You need to work with cross tabs or pivot. I suggest that you do it before joining the dependents view to your query.

    To know how to handle cross tabs, read...

    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: Count days per month per year between 2 dates

    With a calendar table you could count the rows without a problem. 🙂

    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: Are the posted questions getting worse?

    Lynn Pettis (3/10/2014)


    If any one has some free time this person could use some help. I don't have the free time at the moment.

    http://www.sqlservercentral.com/Forums/Topic1549023-391-1.aspx

    I've wasted a lot of time...

    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: What am I Missing ? Converting Legacy Code

    If you're already working on it, why won't you go the whole way?

    SELECTmm.MEMMT_ID,

    mm.MEM_ID,

    mmp.MEMMP_salutation,

    mmp.MEMMP_nickName,

    mmp.MEMMP_firstName,

    mmp.MEMMP_MI,

    mmp.MEMMP_lastName,

    mmp.MEMMP_company,

    mmp.MEMMP_title,

    mmp.MEMMP_address1,

    mmp.MEMMP_address2,

    mmp.MEMMP_address3,

    mmp.MEMMP_city,

    mmp.STA_ID,

    mmp.MEMMP_zipCode,

    mmp.MEMMP_country,

    mmp.MEMMP_homePhone,

    mmp.MEMMP_bizphone,

    mmp.MEMMP_bizPhoneExt,

    mmp.MEMMP_fax,

    mmp.MEMMP_cellPhone,

    mmp.MEMMP_email1,

    mmp.MEMMP_source,

    mmp.MEMMP_refOther,

    (select PROM_CODE from promotion where PROM_ID = mm.PROM_ID),

    mm.MEMMT_cmpgn,

    mm.MEMMT_premium,

    mm.MEMMT_gateway

    FROMMember_Meeting mm

    JOIN Member_MeetingProfile mmp ON mm.memmt_id = mmp.memmt_id

    JOIN Meeting m...

    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: Remove errant readings

    This is an option using 2 deletes. I'm assuming that you don't have gaps on mrid, if you have gaps, you'll need to create an artificial key.

    DELETE r

    FROM Readings r

    JOIN...

    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: Pls let me know how to add image..thanks

    Koen Verbeeck (3/10/2014)


    koti.raavi (3/10/2014)


    Please help me out and Please find attached image..thanks

    The objective of this task is to create a report that will connect to the AdventureWorksDemo database on the...

    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: Trouble with a MERGE statement

    You're welcome. It's great to help, but I wonder if it's the best solution.

    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: Help with hierarchical structure without hierarchical relation field...

    What happens if a parent needs to have more than 10 children?

    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: Trouble with a MERGE statement

    I don't have much experience with MERGE either, but this might help you.

    MERGE dbo.TestA AS trgt

    USING dbo.TestB AS src

    ON trgt.SomeAId = src.SomeBId AND trgt.SomeSubAId = src.SomeSubBId

    WHEN MATCHED THEN

    UPDATE SETSomeAValue =...

    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: get the first date and weekday of every month in a year

    The best option could be a calendar table that can establish those values without further calculations.

    If you don't have it, or can't create it, here's a possible option. Be sure...

    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: Help with hierarchical structure without hierarchical relation field...

    My first choice was to change the SUBSTRING to the LIKE operator to make the query SARGable.

    SELECT t0.accountId, SUM(t1.debit), SUM(t1.credit)

    FROM accounts t0

    LEFT JOIN accountMovs t1 ON t1.accountId LIKE t0.accountId...

    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: Are the posted questions getting worse?

    Ed Wagner (3/10/2014)


    Luis Cazares (3/10/2014)


    Good Monday everyone,

    I've been away for a week and seems a lot to me. I moved to a different area in my company and I've been...

    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: count the order on weekly basis

    Koen Verbeeck (3/10/2014)


    That is fascinating.

    Is there also a question?

    Hint: read the links How to post forum questions[/url] and Need an answer? No, you need a question.

    ps: just to shove you...

    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: Identity for characters column

    I agree with Sean. What will happen when you get to one thousand?

    You could have an identity column and a computed column to show your alphanumeric ID if the characters...

    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: Are the posted questions getting worse?

    Good Monday everyone,

    I've been away for a week and seems a lot to me. I moved to a different area in my company and I've been adapting and learning (and...

    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 - 6,781 through 6,795 (of 8,731 total)