Forum Replies Created

Viewing 15 posts - 91 through 105 (of 430 total)

  • RE: joining on most recent date

    /*I assume from your post Product_id 00001 in the second table is a typo instead of 0001 and you need '23-Nov-2005' in the resultset instead if '20-Nov-2005'. If you really...

    Regards,
    gova

  • RE: Stored Procedure to Excel???

    This will take a lot of time. I would create an Excel file in the webserver and send it to the browser.

    Dim ii , con, rs, stroutput

    con = server.createobject("adodb.connection")

    rs...

    Regards,
    gova

  • RE: Stored Procedure to Excel???

    In Query Analyzer

    Ctrl+Shift+F = Results to File

    Menu Tools > Options > ResultsTab and Select Tab Delimited

    Execute Your Query (SP)

    File window will pop. Choose allfiles and name your file as...

    Regards,
    gova

  • RE: Comparing columns containing null values

    /*

    Sergiy I would say every one knows what you say. But the confusion is how they interpret set ansii nulls off.

    If ansii nuls is off When comapring the column...

    Regards,
    gova

  • RE: Grid vs text in Query Analyzer -each one returning differen results

    We have that problem Query Analyzer quits displaying after that value. Get the results to MSWord or EXcel from the database directly you will be able to see that.

    Character is...

    Regards,
    gova

  • RE: Join to table returned by UDF

    INNER query will return multiple tables and is not possible to do such a join

    CREATE THE UDF AS dbo.fnTransferEntries() such that it returns all transferId,  and TransferAmount

    without a parameter passed...

    Regards,
    gova

  • RE: Nitpicky QA annoyance

    I tested executing several times I did not get the error. I am not sure now. May be some who had or has this problem can check into this.

    I asked...

    Regards,
    gova

  • RE: Nitpicky QA annoyance

    If a GO is used one blank line in the end is avoided. Check using results to grid. (Ctrl+D)

    First this

    /*use GO */

    CREATE PROC TESTTEST

    AS

    SELECT 'TEST'

     

     

    Go

    sp_helptext TESTTEST

    GO

    DROP PROC TESTTEST

    GO

    Then...

    Regards,
    gova

  • RE: Problem SELECTing declared variables

    My Mistake.

    Friday Morning. I didn't realise  @churn1 holds a table name. Sushila is right. Dynamic SQL is the answer.

    Print statement works and select didn't misled me.

    Regards,
    gova

  • RE: Nitpicky QA annoyance

    /*use GO */

    GO

    CREATE PROC TESTTEST

    AS

    SELECT 'TEST'

    GO

    sp_helptext TESTTEST

    GO

    DROP PROC TESTTEST

     

    Regards,
    gova

  • RE: Problem SELECTing declared variables

    Do I miss something here Friday.

    Wouldn't this work!

    declare @churn varchar(20),@churn1 varchar(20)

    set @churn='1005'

    set @churn1='base'+@churn

    print @churn1

    --select * from @churn1

    select  @churn1 churn1

     

    Regards,
    gova

  • RE: How to return values who have more than 2 decimal

    Select the column in question in Excel. Right click. Format cells. Choose the formar required.

    SQL way to get the round

    DECLARE @MyNum DECIMAL(10,5)

    SET @MyNum = 12345.67899

    SELECT @MyNum MyNum, CONVERT(DECIMAL(10,2), @MyNum) Converted,...

    Regards,
    gova

  • RE: Retrieving the NT User Name from a query.

    It would be possible to use NTID as WorkStationID when you use ADO to connect to the databse. I don't know about the others.

    If the connection string is blank...

    Regards,
    gova

  • RE: Retrieving the NT User Name from a query.

    Sorry I missed this post.

    Workstation ID is the property of SQLConnection's connection string property.

    http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlConnectionClassConnectionStringTopic

    If you pass the Workstation ID as your NTID then you can get the NTUser...

    Regards,
    gova

  • RE: How do I calculate data with field from one row and field from next row?

    SET NOCOUNT ON

    DECLARE @TempTable TABLE

    (

    patient  varchar(10),

    datebegin datetime,

    dateend  datetime

    )

    INSERT @TempTable

    SELECT 'A', '1/1/05', '1/31/05' UNION

    SELECT 'A', '4/1/05', '6/30/05' UNION

    SELECT 'B', '2/1/05', '2/28/05' UNION

    SELECT 'B', '3/1/05', '5/27/05' UNION

    SELECT 'C', '5/2/05', '7/1/05' UNION

    SELECT 'C', '7/2/05', '8/15/05'

    SELECT patient, MIN(datebegin) datebegin,...

    Regards,
    gova

Viewing 15 posts - 91 through 105 (of 430 total)