Forum Replies Created

Viewing 15 posts - 766 through 780 (of 1,082 total)

  • RE: Case statement error

    oh and here is the code

    DECLARE @sql VARCHAR(8000),

    @ThreeMonthsAgo VARCHAR(10),

    @FourMonthsAgo VARCHAR(10),

    @FiveMonthsAgo VARCHAR(10),

    @FirstDay_FiveMonthsAgo DATETIME,

    ...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Case statement error

    Hi

    You need to cast/convert your getdate values to VARCHAR's before trying to concatenate them to your main sql string.

    Thats why you get the error.

    Take note the you will need to...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: sql query with like key words.

    Ok I got a solution for you!

    Please not the proc requires a Tally table if you don't have one the code for it is commented out in the beginning of...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Query with multiple string with like operator

    Ok I got a solution for you!

    Please not the proc requires a Tally table if you don't have one the code for it is commented out in the beginning of...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Query with multiple string with like operator

    What is the max number of search criteria?

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: sql query with like key words.

    In your above example, is description a word to be searched or does it mean search for anudeep in the description column?

    THanks

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: sql query with like key words.

    IS this the same question as this:

    http://www.sqlservercentral.com/Forums/Topic546066-338-1.aspx?Update=1

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Query with multiple string with like operator

    here is an example of how it will work.

    DECLARE @vcSearch1 VARCHAR(100)

    DECLARE @vcSearch2 VARCHAR(100)

    DECLARE @vcSearch3 VARCHAR(100)

    DECLARE @tbl TABLE

    ([Name] VARCHAR(1000))

    INSERT INTO @tbl

    SELECT 'Christopher Stobbs' UNION ALL

    SELECT 'pkuchaliya' UNION ALL

    SELECT 'Jack Smith'

    --GET ALL...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Query with multiple string with like operator

    SELECT *

    FROM Employee

    WHERE [Name] LIKE '%' + @vcSearch1 + '%'

    OR [Name] LIKE '%' + @vcSearch2 + '%'

    OR [Name] LIKE '%' + @vcSearch3 + '%'

    etc

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Analytical Interview Questions

    Hi all,

    The one I have come across before, is for a candidate to explain how they would design a system or what they would look out for when designing a...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Analytical Interview Questions

    Ok Got it 🙂

    I'll drop you an email now

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: Analytical Interview Questions

    Are you sure you can only weigh them once?

    I can do it with two weigh in's but not 1 🙁

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: LEFT JOIN vs EXCEPT

    Jeff,

    How would you best two queries to see which is performing better?

    thanks

    Chris

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: SUM function neglects the value with exponential characters

    I agree, I can't get any errors ,so I'm curious about the data more than anything else

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • RE: how to update a rows of data using a function in a Stored Procedure

    LeeLuv

    Please could you let me know the error you get with the Case statement solution above????

    AS mentioned by the other helpers the subquery will prob not give you the...

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life

Viewing 15 posts - 766 through 780 (of 1,082 total)