Forum Replies Created

Viewing 15 posts - 466 through 480 (of 600 total)

  • RE: Distinct first instance

    If you tell us a bit more about the table you are querying we can figure something out.

    Its tough to demonstrate when we are guessing at information.

    For...

  • RE: Too much code for this T-SQL

    dva2007 (6/28/2011)


    Ninja's_RGR'us,

    We have a table with each patient record where they can have multiple opeation code (up to 15 operation). it has to be in a separate column as most...

  • RE: Distinct first instance

    You could use row_number to achieve this.

    The question is whether you actually need to do this to get the unique count for the report. If you could explain...

  • RE: Subquery issue

    Could you explain a bit more in detail what you are trying to do and give us table definitions for the tables you are using?

    In your sample data, how do...

  • RE: update query with IF else statement

    FYI, you can format IF logic into a WHERE clause using CASE if you need to.

    In the above example, though, you probably shouldn't be using all those dateparts in the...

  • RE: Implementing a Proximity Search

    At a quick glance, couldnt see why you would only be getting one hit.

    But some quick observations:

    1)Your code is looking for zip codes within a search box, not radius (as...

  • RE: SQL Query to find the nearest date for Currency ExchangeRate

    Can you post the table definitions so that we can give you a working query instead of pseudocode?

  • RE: COALESCE ?? Replacement?

    This sounds a lot like a homework / test question

  • RE: Dynamic Sql incorrect Syntax..

    Try putting the CTE definition into the string for the dynamic sql. I'm pretty sure you can't link dynamic sql to a CTE the way you tried to.

  • RE: Identifing Gaps in Date Ranges

    NOTE: Actually I have a small logical error in the above. If the "gap" in category is for the entire activeperiod I won't find it.

    Adding the following...

  • RE: Identifing Gaps in Date Ranges

    Wow, this one was nasty.

    First of all, a couple clarifications as housekeeping.

    There are 29 days in Feb in 2008 (affects your expected output)

    Based on your expected output, I think...

  • RE: selecting column names from where clause

    Learner1 (10/19/2010)


    yes, it is dynamically passed ,the list of column is passed through a parameter

    it is dynamic sql, Can be any column in the table like Age ,Salary, Name,...

  • RE: selecting column names from where clause

    Learner1 (10/19/2010)


    Hi all

    Is there any way that I can pass the column names in where clause and select them.

    like

    select * from employee

    where column_name in (age,salary)

    this shows me only Age and...

  • RE: CASE WHEN in Order By statement

    Dominic Gagné (10/19/2010)


    thanks for the replies.

    I figured out that, by using a derived table, it works fine:

    SELECT * FROM

    (

    SELECT DISTINCT

    a.perID,

    a.rxDate,

    a.rowID,

    a.cntNom,

    a.cntOrdre,

    STUFF(

    (SELECT '; ' + CAST(Quantite AS VARCHAR) + ',' + medNom...

  • RE: CASE WHEN in Order By statement

    Could you describe briefly what you want your case in the order by to accomplish?

    There are multiple things wrong here (as noted above, the order by needs to be a...

Viewing 15 posts - 466 through 480 (of 600 total)