Forum Replies Created

Viewing 15 posts - 31 through 45 (of 568 total)

  • RE: select max date record

    Hi,

    Use the inner join of both table with the columns on Acct_no and State, then select the max Visit_date by group the Acct_no.

    Have a question, suppose your Patient table have...

  • RE: concatenate rows (sql server 2000)

    mlandsheer (2/9/2010)


    Im having a really hard time with this in sql server 2000. while 2005 seems to offer easier solutions to solve this issue! i hope someone has a bright...

  • RE: Extracting 'YYWW' from getdate()

    CirquedeSQLeil (2/8/2010)


    I hadn't considered this method. Makes sense though.

    Hi Janson,

    Is there any direct convert method to get the year and week from date time?

    I thought this code having some...

  • RE: Invalid length parameter passed to the substring function.

    Hi

    One of the record in the ftpfile table does’t have the DOT(“.”) character and same which you search in the charindex/substring, hence this error occurred.

  • RE: help to get result from sql server for stock

    KeyurGohel (2/3/2010)


    ITMCOD,OPNQTY,INWQTY,ISUQTY,((OPNQTY+ INWQT)-ISUQTY)AS CLOSQTY

    001 500 1200 500 ...

  • RE: I want to display Custom Error Message!!

    Hi Mahesh,

    But, you can raise this message by you validate the string before updating, is it valid data type to update the target.

    if isnumeric('***')= 0

    begin

    ROLLBACK TRAN

    RAISERROR ('!!INSERT success but UPDATE...

  • RE: Date Range

    Hi Jeff,

    Nothing wrong, the praise from one’s percent mood, so reflect you’re in good disposition!!!

  • RE: Date Range

    Hi Jeff,

    You know about what the newbie’s doing wrong, even you ask such question.

  • RE: Date Range

    SELECT

    (case when n = 1 then @pStartDate

    else DATEADD(mm,DATEDIFF(mm,0,@pStartDate) + (t.N-1),0)end) AS MonthStart,

    (case when n= DATEDIFF(mm,@pStartDate,@pEndDate)+1 then @pEndDate

    else DATEADD(mm,DATEDIFF(mm,0,@pStartDate) + (t.N ),0) -1 end)AS MonthEnd...

  • RE: Date Range

    declare @from datetime,@to datetime

    set @from = '2009-01-10'

    set @to = '2010-10-20'

    SELECT STUFF(CONVERT(CHAR(11),DATEADD(mm, n-1, @from),100),4,3,'') AS MonthName ,

    dateadd(mm, datediff(mm, 0, (DATEADD(mm, n-1, @from)) ), 0) startdate,

    (DATEADD(MONTH, 1, (dateadd(mm, datediff(mm, 0, (DATEADD(mm,...

  • RE: Calculating Differences in Time Between Values in different columns and rows

    Hi Mitesh Oswal,

    I expect this feed back from OP.

    Moreover you just put the if null in the

    isnull(datediff(day,a.End_Date,b.Start_Date),0/*any other values*/)diff

    So that we have map other than zero in this place.

  • RE: Calculating Differences in Time Between Values in different columns and rows

    select a.* ,b.Start_Date,datediff(day,a.End_Date,b.Start_Date)diff

    from

    #Care_Episodes a

    left outer join

    #Care_Episodes b

    on

    a.Person_ID = b.Person_ID

    and

    a.PKID = b.PKID-1

  • RE: How to know what time a table is last-updated?

    SQL ORACLE (1/27/2010)


    not the date of modifying table data.

    Hi,

    Record modified track!!

    Unless you follow the Gail approach or set the audit trial/table to the target table or the target table...

  • RE: Best way to extract SQL from a view.

    Hi Saravanan,

    Nice work,

    But, is its works only in the 2000?

    And just fine turn this code to suit with the below VIEW

    /*

    THIS INFO ALREADY IN THE

    XYZ VIEW, THEN WHY WE...

  • RE: Best way to extract SQL from a view.

    Hi Saravanan,

    The OP says, he got the text when run the sp_helptext, but along with the comment mentioned in the top of the view/procedure, OP need to trim the commend...

Viewing 15 posts - 31 through 45 (of 568 total)