Forum Replies Created

Viewing 15 posts - 3,211 through 3,225 (of 8,731 total)

  • RE: Ms Access Countif equivalent in SQL Server

    I actually like to keep the COUNT. It will eliminate NULL values and the intention is clear.

    Count(CASE WHEN [visit_date] Between '20160201' And '20160229' THEN [registration_cd] END)...

    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 get only the last string before comma

    How about reducing some steps?

    DECLARE @str VARCHAR(250) = 'DWDate,Email,UserID,ID,LoanNum,PersonEmail,LoanDate,Paymt'

    SELECT RIGHT(@str, CHARINDEX(',', REVERSE(@str))-1)

    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: LIKE with 2 searches

    Ed Wagner (3/14/2016)


    planetmatt (3/14/2016)


    Alan.B (3/11/2016)


    Try

    WHERE Item LIKE '%S' OR Item LIKE '%B'

    WHERE Item like '%[S,B]'

    That leading wildcard in the search will force a scan of the column, so 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: Today's Random Word!

    whereisSQL? (3/10/2016)


    Ed Wagner (3/10/2016)


    crookj (3/10/2016)


    Manic Star (3/10/2016)


    Ed Wagner (3/10/2016)


    Revenant (3/10/2016)


    Ed Wagner (3/10/2016)


    Manic Star (3/10/2016)


    DonlSimpson (3/10/2016)


    Grumpy DBA (3/10/2016)


    Ed Wagner (3/10/2016)


    Sound

    Off

    On

    Superposition

    Supposition

    Suppository

    Sick

    Tired

    Tracked

    Terms and Conditions :sick:

    Fineprint

    Unread

    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 Time into Decimal. SQL Decimal into TIME

    You might find some inaccurate results, but a simple conversion to datetime then to time might work.

    SELECT CONVERT( time, CONVERT(datetime, 0.416666666666667))

    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: Changing Data Types

    Are you sure that you don't have invalid strings that escape your validation? Something like 'asd%'

    I tried to replicate the error but wasn't able to do it. This is my...

    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 Needed in Top selection from the list

    Use a CTE with ROW_NUMBER to find the first for each group.

    WITH CTE AS(

    SELECT c.CompanyName,

    v.UserId,

    ...

    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: set default value of date paramter as getdate()-1 in SSRS report

    rcooper 78099 (3/10/2016)


    unfortunately I do not have those options see screen shot attached.

    Luis Cazares (3/10/2016)


    rcooper 78099 (3/10/2016)


    =DateAdd("d",-1,Today())

    I am assuming it would be

    =DateAdd("d",+1,Today())

    or

    =DateAdd("d",1,Today())

    which have both not worked.

    What do you mean 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: set default value of date paramter as getdate()-1 in SSRS report

    Did you follow these steps?

    - Open the Parameter properties.

    - Set Data type to Date/Time.

    - Go to Default Values tab.

    - Click on the formula (fx) button.

    -...

    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: set default value of date paramter as getdate()-1 in SSRS report

    rcooper 78099 (3/10/2016)


    =DateAdd("d",-1,Today())

    I am assuming it would be

    =DateAdd("d",+1,Today())

    or

    =DateAdd("d",1,Today())

    which have both not worked.

    What do you mean by have not worked? How are you assigning the default value?

    I just tested both approaches...

    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: Find a String in a String

    It's a nice article that explains this problem which unfortunately is more common that it should be.

    I'd take a different approach which includes some "safe nets". It seems that your...

    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 create a Stored Procedure from this Code

    gabtugm (3/5/2016)


    Luis Cazares (3/4/2016)


    oneteabag (3/4/2016)


    Nice Thoughts newbie, I got the logging part but wasn't sure if I stay away from SSIS how I would automate this process.? Right now it...

    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: Today's Random Word!

    ThomasRushton (3/9/2016)


    Ed Wagner (3/9/2016)


    BWFC (3/9/2016)


    Grumpy DBA (3/9/2016)


    Ed Wagner (3/9/2016)


    Stuart Davies (3/9/2016)


    shipping

    Receiving

    Yards

    Hard

    Boiled

    shirt

    pants

    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: Connect to SQL instance on Mac

    Del Lee (3/9/2016)


    Luis Cazares (2/25/2016)


    Try this

    Luis, I imagine the original poster already did a google search. Which ones do you have experience with? Do you have a recommendation?

    You're...

    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: Split string into multiple entries based upon known static length

    The code already has that value. If you can't find it, maybe you're not understanding how this works.

    Please, try to explain it and ask any questions you might have.

    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 - 3,211 through 3,225 (of 8,731 total)