Forum Replies Created

Viewing 15 posts - 301 through 315 (of 1,468 total)

  • Reply To: Need help. Find matchng Substring

    You will  need to test, but using PATINDEX *might* give you slightly better performance.

    SELECT T1.DocumentNo, T2.LongSentence
    FROM Table2 T2
    INNER JOIN Table1 T1 ON PATINDEX('%' + T1.DocumentNo + '%',...
  • Reply To: case statement

    Since your query is returning no results, it cannot display a yes/no answer.

    What you need to do is change it so that it always returns a result

    SELECT...
  • Reply To: case statement

    Looks like you are missing a closing quote in the WHEN part of your case statement.

  • Reply To: Count the Number of Weekend Days between Two Dates

    ScottPletcher wrote:

    Here's my version, also no recursion, with added alias names for more clarity:

    SELECT 
    start_date, end_date,
    full_weeks * 2 +
    ...
  • Viewing 15 posts - 301 through 315 (of 1,468 total)