updated code since the post.

now working on the linked file charindexrev

ALTER function [dbo].[isSubTotal](@objectiveNo char(10)) 
        
        returns int
as
begin
        declare @periodPos int

        set @periodPos = dbo.charIndexRev('.',@objectiveNo)

        if ((charindex('.', @objectiveNo) = 0))begin
                return 0
        end

        if (charindex('.', @objectiveNo) = 0) begin
                return 0
        end

        if (len(@objectiveNo) - dbo.charIndexRev('.', @objectiveNo) < 2) begin
                return 0
        end

        return 1
END



> I have a list of objectives in a mssql table that are ordered by 
> objective numbers that run 1.0, 1.1, 1.2, 1.3, 2.0, 2.1, 2.2, 2.3, etc.
> 
> 
> what i am trying to do is create a char index that will group the 
> objective numbers by the character before the period in order to get 
> subtotals for all objective beginging with 1, 2, 3, etc.
> 
> this is what i have so far.
> 
> ALTER function [dbo].[isSubTotal](@objectiveNo char(10)) 
>       
>       returns int
> as
> begin
>       declare @periodPos int
> 
>       set @periodPos = ('.')
> 
>       if ((charindex('.', @objectiveNo) = 0))begin
>               return 0
>       end
> 
>       return 1
> END 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:303319
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to