Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • RE: Replace non numeric characters in string

    CREATE function dbo.udfGetNumVal

    (

    @strInput nvarchar(50)

    )

    Returns DECIMAL(18,0)

    AS

    BEGIN

    DECLARE @iCtr INT

    DECLARE @AscVal INT

    DECLARE @NumVal NVARCHAR(100)

    SET @iCtr = 1

    SET @NumVal = ''

    WHILE @iCtr <= Len(@strInput)

    BEGIN

    SET @AscVal = Ascii(substring(@strInput,@iCtr,1))

    IF (@AscVal >= 48) and (@AscVal <= 57)

    BEGIN

    SET...

  • RE: getting only date from datetime

    select count(datetime) from XYZ where convert(datetime,left((convert(nvarchar,datetime),11)) = '2008-05-15'

Viewing 2 posts - 1 through 2 (of 2 total)