Forum Replies Created

Viewing 15 posts - 61 through 75 (of 80 total)

  • RE: Increment each row by selected by 10

    Hey John Mitchell I took your advice and included PARTITION BY which has worked perfectly, thanks for the advice

    Sample

    SELECT 'PL01_'+ RTRIM(Vendor) + '_' + RTRIM(Shipto) + '_'+RTRIM(CONVERT(char(20),GETDATE(),112))+'_'+CONVERT(CHAR(8),SYSDATETIME(),114)AS[Document No]

    ,Ltrim((RIGHT(REPLICATE('0',...

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Increment each row by selected by 10

    Hi

    I would like to make slight chances to the code above i still want it to increment by 10 but to be unique according to the

    Vendor and Shipto...

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Increment each row by selected by 10

    Not to worry I've sorted it out

    [Code]

    RIGHT(REPLICATE('0', 5) + CONVERT(VARCHAR(10), ROW_NUMBER()over(Order by P.Vendor)+0) + '0', 5) AS [Document Item No]

    [/Code]

    Thanks a lot for your help

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Increment each row by selected by 10

    Many Thanks for your reply Ninja's_RGR'us

    I need it to start from 00010, 00020 00030 etc could you show me how that's done

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Concatenating two columns to make a reference and include the date and time

    Does anyone know how i can create an AUTO INCREMENT column WITHOUT incorporating it when creating a table.

    The same results I posted above but create another column lets say...

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Concatenating two columns to make a reference and include the date and time

    Phil , Calvo, Chaz many thanks for your reply

    Phil , Calvo both of your were nearly right, from your scripts i was able to construct what i needed...

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: to insert data from one table to another

    This is exactly what i was looking for myself thanks for the post

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Create a look up in SQL similar to HLookup in Excel

    Thanks for the post it worked perfectly

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Create a look up in SQL similar to HLookup in Excel

    Just a quick one I want to Current_Stock by Standard_Cost for example, Standard_Cost * current_stock i was sure this could of been done within StockSafety_CTE. I'm assuming...

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Create a look up in SQL similar to HLookup in Excel

    Right i understand it perfectly now I just need to incorporate the caluculation in the StockSafety_CTE section of the code not add another CTE brilliant. Thanks alot for the help...

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Create a look up in SQL similar to HLookup in Excel

    Oh wow that was quick thanks alot for writing that for me and the Forum Etiquette

    I want to use CURRENT_ABC_WEEKS to perform similar calculation roughly 4 more.

    Would i need...

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Create a look up in SQL similar to HLookup in Excel

    Hi opc.three

    Sorry for the delay

    Table 1

    -- Inserting data in Lim_ABC_Table

    CREATE TABLE [dbo].[Lim_ABC_Table](

    [ITEM] [varchar](50) NULL,

    [BU] [int] NULL,

    [SUBFAMILYDESC] [varchar](50) NULL,

    [SUBFAMILYCODE] [varchar](50) NULL,

    [CURRENTABC1] [varchar](50) NULL,

    [LASTMONTHSIX] [int] NULL,

    [STANDARDCOST] [decimal](18, 2) NULL,

    [CURRENTABC] [varchar](10) NULL,

    [CURRENTSIXMONTHSFORECAST]...

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Create a look up in SQL similar to HLookup in Excel

    Can you show me how you would code this as i'm not to sure how

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Create a look up in SQL similar to HLookup in Excel

    opc.three many thanks for your reply and comments much apprenciated

    I took your advice and used the Case expression as i found it more easier to code

    SELECT ...

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

  • RE: Two similar queries returning completely different results!!!

    Thansk for your reply GilaMonster , skcadavre

    To be honest i dont know where i didnt think of that lol, i'll try that now

    __________________________________________________________________________________
    Steve J
    Jnr Developer
    BSc(Hon)

Viewing 15 posts - 61 through 75 (of 80 total)