Forum Replies Created

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

  • RE: How to Select table without null value

    coalesce: This function checks all the columns specified in the function and returns the column value which is not null. Simply we can say Returns the first nonnull expression among...

  • RE: Want to use WHILE loop in Stored procedure

    You can use Datediff function also. Like the Datediff('d',@FromDate,tableData) > =0 and Datediff('d',@ToDate,tableData) <=0.

  • RE: Query results to a text file in a specified path

    declare @CodeLen int,

    @strSQL varchar(4000)

    SELECT @CodeLen = MAX(DATALENGTH(Code)) from History_temp

    --print @CodeLen

    set @strSQL='SELECT POL_NO [Policy]

    ,Name

    ,AGY_NO [Agency]

    ,Initials

    ,cast(Code as varchar( ' +@CodeLen + ')) [Code]

    ,Method

    ,createdOn AS [Received Date]

    FROM History_temp...

  • RE: query for between dates

    Please ignore my previous post some of the character are not displayed

    Let us assume from date = 04/10/2009 and to date = 04/20/2009

    then

    SELECT * FROM Table t WHERE Userid...

  • RE: query for between dates

    Let us assume from date = 04/10/2009 and to date = 04/20/2009

    then

    SELECT * FROM Table t WHERE Userid = 100

    AND (@FromDate between t.FromDate...

  • RE: Stored Procedure Basics

    Create procedure name

    @value varchar(50),

    @value2 varchar(150)

    as

    begin

    declare @myValue int

    SET @myValue=0

    Select @myValue = isnull(count(*),0) + 1 from myTable

    Insert into myTable values( @myValue, @value, @value2 )

    end

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