Forum Replies Created

Viewing 15 posts - 2,596 through 2,610 (of 8,731 total)

  • RE: Expression For Converting Start/End Time to HH:MM

    Please share the values and data types, with the end format you wish to obtain. Please post different examples to understand the different possibilities.

    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: SQL Server 2016 Developer Edition

    The moment that you can't trust a restore from Dev to Prod, the data is no longer production data. However, you might want to review the restores from to Dev...

    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: Return string between 2 characters from the end of the string

    I'm sorry, but that doesn't help. I need the column definition, apparently you're using a char column, but that's just a guess. Read the articles linked in my signature to...

    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: Convert numeric field (date field) into date field

    Something like this?

    SELECT CONVERT(date,CONVERT(char(6),'160627'),12)

    Avoid storing dates as numbers or strings. Use date/time data types which will allow better performance and capabilities.

    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: Return string between 2 characters from the end of the string

    Please post DDL and the values that give NULL as a result.

    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: Return string between 2 characters from the end of the string

    If you don't have periods and the lengths of your strings are not over 128 chars per section, this can be an option.

    SELECT PARSENAME(REPLACE('INV CRT IS15000467 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: Expression For Converting Start/End Time to HH:MM

    Go to the properties window for your columns. Go to the Number tab and select Time in Category as well as your preferred format.

    You can also use the format function:

    =Format(...

    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: Is there a function to format the date like this ?

    Not a big improvement, but might help.

    SELECT STUFF( REPLACE( '/' + CONVERT(CHAR(10), @xx, 101 ), '/0', '/' ), 1, 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: Find value is prim or not

    MadAdmin (6/24/2016)


    drew.allen (6/24/2016)


    I think that Luis' solution will perform faster than any looping solution, especially once the square root short circuit is added.

    Drew

    surely the cte is faster, but they do...

    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?

    TomThomson (6/24/2016)


    Ed Wagner (6/22/2016)


    jasona.work (6/22/2016)


    TomThomson (6/22/2016)


    jasona.work (6/22/2016)


    /me leans back, marveling at what happens when you toss a crystal into a supersaturated solution...

    Sounds like the next couple weeks / months are...

    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: Convert multiple rows to columns Dynamically

    hmobasher (6/24/2016)


    oops...I have overlooked that one. Now, it runs with no error but I get no records at all!

    Did you remove the WHERE clause from the dynamic code?

    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: Convert snippet from VBA to SQL

    EDIT: misinterpreted

    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: Convert multiple rows to columns Dynamically

    The error message tells you the problem. You didn't uncomment the TOP clause.

    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: Convert multiple rows to columns Dynamically

    Be sure to understand this and ask any questions that you might have.

    DECLARE @serviceid int = 66;

    DECLARE @sql nvarchar(max);

    WITH

    E(n) AS(

    SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)

    ),

    cteTally(n) AS(

    ...

    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?

    Eirikur Eiriksson (6/24/2016)


    jasona.work (6/24/2016)


    ChrisM@Work (6/24/2016)


    Eirikur Eiriksson (6/24/2016)


    Luis Cazares (6/24/2016)


    I'm sorry, is there any country that can give me good news? It seems that Mexico, US and UK are full of...

    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 - 2,596 through 2,610 (of 8,731 total)