Forum Replies Created

Viewing 15 posts - 1,996 through 2,010 (of 8,731 total)

  • RE: function to clean a phonenumber

    ninamahezi (10/25/2016)


    thanks very much for your help

    I need a function with a return statement and the parameter will be a phonenumber

    Thanks

    Then create it. Just remember that scalar user defined...

    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: Counting field values per day between specific date ranges

    I'm posting the function again with some comments. Hopefully those comments will help you understand how the query is working. I should strongly recommend that you read the following article...

    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!

    Ed Wagner (10/25/2016)


    Grumpy DBA (10/25/2016)


    djj (10/25/2016)


    Line

    White

    Snow

    flake

    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: function to clean a phonenumber

    ninamahezi (10/25/2016)


    Hello,

    I want a sql function that will allow to make one update but with several replace on the same column.

    For exemple

    Replace the space by vacuum('')

    ...

    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: Compare two columns before insert

    Please post DDL, sample data and expected results. If you don't know how to do it, read the links in my signature.

    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: Views from other database (Same server)

    .Patrick (10/24/2016)


    Hi all,

    Currently we are developing a new application for our company and I got a question related to the database architecture. We one database (DatabaseA) that is our main...

    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!

    ZZartin (10/24/2016)


    Ed Wagner (10/24/2016)


    Manic Star (10/24/2016)


    Ed Wagner (10/24/2016)


    djj (10/24/2016)


    Revenant (10/24/2016)


    Ed Wagner (10/24/2016)


    Grumpy DBA (10/24/2016)


    Kaye Cahs (10/24/2016)


    Sausage

    Fest

    October

    Halloween

    Movie

    Theater

    Popcorn

    Butter

    Face

    Book

    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: Counting field values per day between specific date ranges

    Here are 2 options, depending on what you want. It's simulating a calendar table, but you might want to consider a full calendar table in your system to make some...

    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: Counting field values per day between specific date ranges

    Do you need to include all dates? Or just the dates with bookings? The solution could be slightly different.

    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: Calculate age in 6 months

    AIRWALKER-375999 (10/24/2016)


    Thom A (10/24/2016)


    If you are using your above logic, ensure you change your Current DOB logic as well. Otherwise, you'll notice that some other current ages will be wrong...

    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: Aggregate Different Values

    A different approach, just for the sake of having options.

    WITH CTE AS(

    SELECT *, RANK() OVER( PARTITION BY col1, col2 ORDER BY col3) rnk

    ...

    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: Rearrange Display 3 id per row(6 rows 3 columns to 2 rows 9 columns)

    Here's an option. It seems a bit odd this requirement. The ORDER BY in the ROW_NUMBER function should probably be changed.

    SELECT

    MAX( CASE WHEN rn...

    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: Calculate age in 6 months

    If you have the logic for today's age, you have the problem solved. You just need to change the way you approach your solution. In six months, they'll be 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: Rearrange Display 3 id per row(6 rows 3 columns to 2 rows 9 columns)

    There's no way to order the data as it is, so there's no way to ensure a consistent ordered result without hard coding values.

    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: Let the shell free

    Jeff Moden (10/23/2016)


    The correct answer is only a 1/4 correct. You also have to enable advanced options and RECONFIGURE twice (once for the advanced options and once to enable...

    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 - 1,996 through 2,010 (of 8,731 total)