Forum Replies Created

Viewing 15 posts - 76 through 90 (of 162 total)

  • RE: An interesting task

    The performance of my code could be further improved by using a STATIC cursor. This performance gain would be most evident when the date ranges spanned multiple years since...

  • RE: An interesting task

    well0549,

    I do not believe that I said your code would not work. The reason I made the comment regarding SQL2000 was that abhi_develops's initial post states that this has...

  • RE: An interesting task

    Minor correction to my code, the line below....

    while @Counter < len(@Calender)

    ...should read......

    while @Counter <= len(@Calender)

    ....sorry abhi_develops

  • RE: An interesting task

    .....if a temp table, just look at all that IO!!!

  • RE: An interesting task

    well0549 your solution will only work for SQL2000 and I have no idea which version abhi_develops is currently using.

    Everyone seems to be knocking how this data is stored but thinking...

  • RE: An interesting task

    Here is another way to do it which looks a bit simpler.

    declare @StartDate datetime,

    @EndDate datetime

    set @StartDate = '20030115'

    set @EndDate = '20030120'

    declare@Year int,

    @Calender char(372),

    @PreDays int,

    @PostDays int,

    @WorkingDays int,

    @NonWorkingDays int,

    @DummyDays int,

    @Counter int,

    @Day char(1)

    set...

  • RE: Table join, row value to column name

    Having re-read your initial post I think that what you are trying to acheive is a join between the tables which subject to the value in the PriceCodeID field (which...

  • RE: Table join, row value to column name

    Do you have a fixed number of PriceCodeID's which you wish to pivot or can the number of values vary.

    The manner in which a pivot is achieved will vary considerably...

  • RE: Dele

    Probably the best way to achieve this is to create a scheduled job to delete all records in the table with dates more than a year old.

    The only choice you...

  • RE: Conversion to DATETIME

    Dont you just love it when someone takes two other peoples ideas and makes a better one from combining them.

  • RE: Conversion to DATETIME

    This is not quite as short as DavidT's but it is an alternative way of approaching the issue.

    select dateadd(hh, (convert(bigint, @eftv_dt) % 1000000) / 10000, dateadd(mi, (convert(bigint, @eftv_dt) % 10000)...

  • RE: Calculate and Carry-over Balance

    Presuming that your fldDate field is actually a datetime field and is unique you can use the following.

    selectfldDate,

    fldTrxType,

    fldAmount,

    (select sum(convert(money, case when fldTrxType = 'Withdrawal' then -1 else 1 end) *...

  • RE: Format to title case

    Apologies, I recall now that I used the StrConv function and created a VBComponent which I then called from VBScript.

    It worked, but was slow. Sorry.

  • RE: Trigger question

    Can you clarify what you are aiming to achieve from your trigger since it is usual to make use of the Inserted, Deleted tables within the trigger.

  • RE: Format to title case

    There is no native method of doing this in SQL Server.

    You could however create a DTS package which processed the data in your tables using the following VBScript command.

    StrConv(strValue, vbProperCase)

    ...

Viewing 15 posts - 76 through 90 (of 162 total)