Forum Replies Created

Viewing 15 posts - 661 through 675 (of 1,048 total)

  • RE: Insertion in table

    ChrisM@Work (3/19/2013)


    kapil_kk (3/18/2013)


    ...How to achieve this?

    plz help

    Do you need help with the stub code I posted?

    Thanks Chris, I have implemented that thing....

    But I am not clear why you posted that...

  • RE: select first alphabet

    ChrisM@Work (3/19/2013)


    kapil_kk (3/19/2013)


    i have a column in my table which has values like 'value Based', 'value Discount', 'Percentage Discount'.

    I want to extract first letter from these words as 'VB', 'VD',...

  • RE: select first alphabet

    Prasad.N (3/19/2013)


    hi

    find below code

    declare @retval varchar(100)

    DECLARE @Str VARCHAR(100);

    set @Str='Nyal Pra Raj'

    SET @str=RTRIM(LTRIM(@str));

    SET @retval=LEFT(@str,1);

    WHILE CHARINDEX(' ',@str,1)>0 BEGIN

    ...

  • RE: Print error message

    ChrisM@Work (3/18/2013)


    Split thread. Original here.

    Hey Chris I am not getting what you want to point out by this :w00t:

  • RE: First and Last number

    ChrisM@Work (3/18/2013)


    kapil_kk (3/18/2013)


    ;with cte as

    ((select min(VoucherNo) VoucherNo, TransactionID from GV_Voucher

    group by TransactionID

    --order by VoucherNo asc

    )

    union all

    select max(VoucherNo)VoucherNo, TransactionID from GV_Voucher

    group by TransactionID

    --order by VoucherNo desc

    )

    select * from cte

    Thsi...

  • RE: First and Last number

    Eugene Elutin (3/18/2013)


    kapil_kk (3/18/2013)


    Eugene Elutin (3/18/2013)


    SELECT TransactionID, MIN(VoucherNo) , MAX(VoucherNo )

    FROM yourtable

    GROUP BY TransactionID

    can you plz explain me how Min, MAX is working with alphanumeric values like 'VB00001'

    In the same...

  • RE: First and Last number

    Eugene Elutin (3/18/2013)


    SELECT TransactionID, MIN(VoucherNo) , MAX(VoucherNo )

    FROM yourtable

    GROUP BY TransactionID

    can you plz explain me how Min, MAX is working with alphanumeric values like 'VB00001'

  • RE: First and Last number

    ;with cte as

    ((select min(VoucherNo) VoucherNo, TransactionID from GV_Voucher

    group by TransactionID

    --order by VoucherNo asc

    )

    union all

    select max(VoucherNo)VoucherNo, TransactionID from GV_Voucher

    group by TransactionID

    --order by VoucherNo desc

    )

    select * from cte

    Thsi will also...

  • RE: DATETIME - 4

    very good question to start of the week.. 😛

  • RE: Data not inserting

    I have solved it..... forget to initialize the IsBookelet variable value ;-):w00t:

  • RE: Data not inserting

    This is the table structure if anyone requires:

    REATE TABLE [dbo].[GV_Voucher](

    [VoucherId] [int] IDENTITY(1,1) NOT NULL,

    [VoucherTypeId] [int] NOT NULL,

    [VoucherNo] [varchar](20) NOT NULL,

    [Denomination] [int] NOT NULL,

    [BookletId] [int] NULL,

    [ExpiryDate] [date] NULL,

    [CreatedDate] [datetime] NULL,

    [ModifyDate] [datetime]...

  • RE: Casting question

    Danny Ocean (3/15/2013)


    kapil_kk (3/15/2013)


    Danny Ocean (3/15/2013)


    Really a nice and good question.

    one more thing apart from this question. if you set ARITHABORT OFF and then execute below code, it will give...

  • RE: Casting question

    Danny Ocean (3/15/2013)


    Really a nice and good question.

    one more thing apart from this question. if you set ARITHABORT OFF and then execute below code, it will give output as "*"...

  • RE: Casting question

    Danny Ocean (3/15/2013)


    Really a nice and good question.

    one more thing apart from this question. if you set ARITHABORT OFF and then execute below code, it will give output as "*"...

  • RE: Casting question

    demonfox (3/14/2013)


    cheeky ...

    didn't occur a doubt on the 0 😛

    though I had a doubt over

    select isnull ( convert (char(3),1.0/9) ,'*')

    -- or

    select isnull ( convert (char(3),1/9.0) ,'*')

    and it clears out...

Viewing 15 posts - 661 through 675 (of 1,048 total)