Forum Replies Created

Viewing 15 posts - 1,876 through 1,890 (of 2,171 total)

  • RE: Alternative for LEFT JOIN

    Aravind, try this solution and see if it does the trick for you

    SELECT     a.ID,

               MAX(CASE WHEN b.Col2 = 'X' THEN b.Col1 END) X,

               MAX(CASE WHEN b.Col2 = 'Y' THEN...

  • RE: Problems with VB code in Access 2003

    Also you consider changing your database engine from DAO to ADO in ACCESS 2003 when upgrading a solution from ACCESS 97.

  • RE: How can I get the result of store procedure in visual basic?

    Yes, that is because SQL Server automatically has a RETURN_VALUE output, shich you need to catch.

  • RE: sql server express edition

    You can do without DTS. You can use OPENROWSET instead.

     

  • RE: Query a string of text?

    Use CHARINDEX function.

     

    SELECT Calldata, CHARINDEX('/', Calldata) FROM [Ron's Table]

  • RE: Stored procedure for Median

    Call with either.

    SELECT           Priority,

                     MIN(dbo.fnMEDIAN(NULL, Priority, 2)) Median,

                     COUNT(*) Count

    FROM             MyTable

    GROUP BY         Priority

    ORDER BY         Priority

    Or

    SELECT           Priority,

                     MIN(dbo.fnMEDIAN(NULL, Priority, 3)) Median,

                     COUNT(*)...

  • RE: Stored procedure for Median

    Yes. Replace the MEDIAN function with this new one. For getting the median over Priority only, call this function with dbo.fnMEDIAN(NULL, Priority, 2) or dbo.fnMEDIAN(NULL, Priority,

  • RE: Query records in last 12 months

    Dinakar has a solution, but the way he wrote it, the database can't use any index for the date column.

    Use this instead

    SELECT * FROM my_table where created_date >=...

  • RE: Stored procedure for Median

    SELECT           [Type of Request],

                     Priority,

                     MIN(dbo.fnMEDIAN([Type of Request], Priority, 0)) Median,

                     COUNT(*) Count

    FROM             MyTable

    GROUP BY         [Type of Request],

                     Priority

    ORDER BY         [Type of Request],

                     Priority

    Or

    SELECT          ...

  • RE: Adding a known variable in Stored Procedure

    David, you are aware the BETWEEN operator is INCLUSIVE with limits?

    In your case, BETWEEN 7 AND 15 is true for hours 07, 08, 09, 10, 11, 12, 13, 14 and...

  • RE: Adding a known variable in Stored Procedure

    You mean something like this? I took the liberty to rewrite and optimize your procedure a little...

    ALTER PROCEDURE dbo.p_dtu_Store_Line_Fault_Data

    (

        @AssetID int,

        @Timestamp datetime,

        @FaultCode int,

        @State int

    )

    AS

    August 2, 2006 at 1:52 am

    #652745

  • RE: returns 1 line from many rows NOT using cursor or loop

    -- prepare test data

    declare @section table (companyid int, sectionid int, classid int, sectiontyid int)

    insert @section

    select 1370, 295, 198, 1 union all

    select 1370, 300, 198, 2 union all

    select 1370, 482, 277,...

  • RE: File Comparison

    Yes, there are easy ways.

    Let us know what the files look like and how you compare two rows.

  • RE: File Comparison

    By using LEFT JOIN and check for NULL values in column.

    And query the files with OPENROWSET function.

    Sorry I can't help you more, but if...

  • RE: Create (U)SP in database on linked server

    What happened when you tried the first and second time?

     

Viewing 15 posts - 1,876 through 1,890 (of 2,171 total)