Forum Replies Created

Viewing 15 posts - 391 through 405 (of 898 total)

  • RE: Selecting very specific records ...

    You can use ROW_NUMBER() to achieve the desired results

    SELECT*

    FROM(

    SELECTROW_NUMBER() OVER ( PARTITION BY Client.ID, Patient.SSN ORDER BY StartOfCare ) AS RN,

    Client.ID, Client.ClientName, Patient.ClientID, Patient.SSN, Patient.StartOfCare, Patient.PrimDiag

    FROMClient Client

    INNER JOIN Patient Patient...

  • RE: DATEDIFF with days and hours

    This should help you

    DECLARE@table TABLE

    (

    IDINT,

    StartDateDATETIME,

    EndDateDATETIME

    )

    INSERT@table( ID, StartDate, EndDate )

    SELECT1, '2013-02-17 10:33:10', '2013-02-17 20:14:40' UNION ALL

    SELECT1, '2013-02-13 12:42:55', '2013-02-14 14:30:50' UNION ALL

    SELECT1, '2013-02-12 15:04:32', '2013-02-15 12:22:25' UNION ALL

    SELECT1, '2013-02-16 20:08:18', '2013-02-18...

  • RE: Display on Month and Year from date formula ??

    Jeff Moden (2/15/2013)


    I suppose consistency is a good reason. But, let's try something just for fun. Write some code to add 41:41:41.041 to a given date.

    My version

    DECLARE@date DATETIME

    SET@date...

  • RE: Alternate to Joins

    Compassionate (2/5/2013)


    folks,

    i have 10 to 20 tables to be joined to get required results but i heard joins on so many tables is not an ideal option. could you tell...

  • RE: How to use Select within select in the same Select statement..??

    bhushan_juare (2/4/2013)


    [font="Courier New"]Hi All,

    I Have table where it includes fields model_size, model_type, actual_qty, process_qty, order_type. Now I want to display all fields + model_size who has order_type = 'Some X'...

  • RE: What forum best for question about replication on SQL Server 2012?

    If you are confused, ask the question in the forum that seems best fit according to you

    As far as your question is concerned, I think you can ask your question...

  • RE: Oops! SQL column swap or SQL column clobber?

    Great Question. But the link provided has no information specific to this behavior.

  • RE: Help with a query

    You did not get any results because you probably did not have records in table "Tickets" where "Reported_by = Assign_to"

    SELECTUsersTbl.Name AS first, UsersTbl.Name AS second

    FROMTickets

    INNER JOINUsersTbl ON Tickets.Reported_by = UsersTbl.Id...

  • RE: TIME/DATE Datatypes Accuracy.

    A nanosecond (ns) is one billionth of a second (10-9 or 1/1,000,000,000 s)...( From Wikipedia http://en.wikipedia.org/wiki/Nanosecond )

    As an example, a variable with data type TIME may store a data like...

  • RE: How to Loop through all DBs in an Instance?

    tom.moore.777 89426 (1/23/2013)


    Can anyone provide a method to loop through a DB's in an instance WITHOUT using the proc sp_MSforeachdb

    Any particular reason for avoiding the use of sp_MSforeachdb?

  • RE: Adding column in where condtion dynamically

    You can implement this with Dynamic SQL as well

    DECLARE@TableName VARCHAR(100), @sql VARCHAR(1000)

    SET@TableName = 'agent'

    SET@sql= ' SELECT* '

    + ' FROM ' + @TableName

    + ' WHERE ' + CASE WHEN @TableName IN...

  • RE: query question

    scotdg (1/10/2013)


    I browsed tha article and to be honest I am not sure I know enough SQL to write what I am trying to do in a way that would...

  • RE: Mulit row update triggers

    venki83k (1/8/2013)


    Hi

    I am executing this against database i got above error .

    Basically using this to track db growth of all database on a server.colud you please suggest anybody on...

  • RE: T-SQL

    dineshbabus (1/3/2013)


    oh.. unique constraint can allow more than one null value.. I don't think so.. Please give me some xample...

    In SQL Server 2008, there is a concept of filtered indexes.

    You...

  • RE: Query for Selecting Two Tables

    You can look up INNER JOIN and GROUP BY Google or Books Online

    Using these two concepts, you can get the desired result

    If you face any further issues get back to...

Viewing 15 posts - 391 through 405 (of 898 total)