Forum Replies Created

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

  • 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)

  • 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...

  • 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

  • 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))

  • 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...

  • 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,

    ...

  • 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...

  • 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.

    -...

  • 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...

  • 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...

  • 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...

  • 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

  • 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...

  • 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.

  • RE: Split string into multiple entries based upon known static length

    Using a tally table and SUBSTRING(), it's very easy to accomplish this. In this example, I'm using a cte to create the tally table on the fly.

    Consider changing the text...

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