Forum Replies Created

Viewing 15 posts - 5,416 through 5,430 (of 26,490 total)

  • RE: Table Valued Function

    forrest77 (4/24/2015)


    Lynn, this is the table.

    CREATE TABLE [dbo].[EditLog](

    [Id] [INT] IDENTITY(1,1) NOT NULL,

    [EditDate] [DATETIME] NOT NULL,

    [PlanId] [INT] NOT NULL,

    [TransId] [INT] NOT NULL,

    [EntityId] [INT] NOT NULL,

    [QtyPrior] [FLOAT] NULL,

    [QtyAfter] [FLOAT] NOT...

  • RE: Table Valued Function

    Taking the "sample data" you posted as if it were the data in a table, here is how I would get the most recent row of data for each PlanId:

    /*

    Id...

  • RE: Table Valued Function

    forrest77 (4/24/2015)


    here is some some records. all are same records but the edit time are different. I would like to have a cursor or something else that can through...

  • RE: Table Valued Function

    forrest77 (4/24/2015)


    CREATE FUNCTION dbo.ADMC_DDL_GetUniqueEditEdit()

    RETURNS @EditLog TABLE(

    Id INT NOT NULL

    ,EditDate DATETIME NOT NULL

    ,PlanId INT NOT NULL

    ,TransId INT NOT NULL

    ,EntityId INT NOT NULL

    ,QtyPrior FLOAT NULL

    ,QtyAfter FLOAT NOT NULL

    ,Description VARCHAR(255) NULL

    ,NotText NVARCHAR(max) NULL

    )

    AS

    BEGIN

    INSERT...

  • RE: Table Valued Function

    I think you are making this harder than it actually is. Could you post the DDL (CREATE TABLE statement) for the tables involved, some SAMPLE data for both tables...

  • RE: SQL query help

    CELKO (4/24/2015)


    Of course there is, since you can cast the number to a string any time you want, although you'd never need to compute a check digit that's already...

  • RE: Are the posted questions getting worse?

    Steve Jones - SSC Editor (4/24/2015)


    jonathan.crawford (4/24/2015)


    Steve, my brother is getting hitched on the 4th of July weekend in Breckinridge. I'm not sure we're going to be able to make...

  • RE: Are the posted questions getting worse?

    jonathan.crawford (4/24/2015)


    Steve, my brother is getting hitched on the 4th of July weekend in Breckinridge. I'm not sure we're going to be able to make it, but assuming we do...

  • RE: Idera Alerts

    Sounds like they are using UTC time in their tables.

  • RE: Delete statement suggestion that will help me fix my statement

    mistylove98 (4/23/2015)


    Thanks all for the help I feel kinda stupid now. Yes it should not have been shipped date it should have been

    delete LMOrders where OrderDate between 10-10-1996...

  • RE: Results in my new query window

    Well, that is the result of that particular query. You inserted a single row of data into a table and SQL Server reported 1 row inserted.

    If you had surrounded...

  • RE: Delete statement suggestion that will help me fix my statement

    mistylove98 (4/23/2015)


    I get this error when i try it that way

    Msg 241, Level 16, State 1, Line 1

    Conversion failed when converting date and/or time from character string.

    Is ShippedDate actually a...

  • RE: SQL query help

    ScottPletcher (4/23/2015)


    Stripping out delimiters should never eliminate information from the data. If you need to, you can set a tinyint code that reflects the meaning of the delimiters. ...

  • RE: Delete statement suggestion that will help me fix my statement

    Not quite how I would do it, but give this a try:

    delete from

    dbo.LMOrders

    where

    OrderDate between '19961010' and '19961025'

    and ShippedDate...

  • RE: ''copy' is not recognized as an internal or external command, operable program or batch file.

    Make the following change to your code above:

    SET @cmd = '"copy ' + @dir + '\*.*' + ' ' + @extPAth +'"'

Viewing 15 posts - 5,416 through 5,430 (of 26,490 total)