Forum Replies Created

Viewing 15 posts - 2,461 through 2,475 (of 3,544 total)

  • RE: SQL UDF to return hours

    Self taught, mostly by practice and looking at samples and experience. BOL and web search helps and looking at forums like this one. This forum has a lot of articles...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SQL UDF to return hours

    Try this

    CREATE FUNCTION dbo.fn_CalculateMinutes

      (@DateFrom datetime, @DateTo datetime)

      RETURNS int

    AS

    BEGIN

        DECLARE @hFrom int, @hTo int, @mFrom int, @mTo int, @hol int

        SET @DateFrom =...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: SQL UDF to return hours

    Try this

    CREATE FUNCTION dbo.fn_CalculateHours

      (@DateFrom datetime, @DateTo datetime)

      RETURNS int

    AS

    BEGIN

        DECLARE @hFrom int, @hTo int

        SET @DateFrom = (CASE DATEPART(weekday,@DateFrom)

            WHEN 1 THEN...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: incorrect result with this stored procedure..

    You cannot ORDER BY on a column alias

    try changing GROUP_ID to #groups.[ID] in the ORDER BY clause

     

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: String formatting - Postcode

    Why run around the block when you can nip through the alley

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: String formatting - Postcode

    SELECT STUFF(@postcode,LEN(@postcode)-2,0,' ')

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Varying return values for Servername

    SERVERPROPERTY in BOL has this

    The ServerName property of the SERVERPROPERTY function and @@SERVERNAME return similar information. The ServerName property provides the Windows NT server and instance name that together make...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Connecting to sql server from Query Analizer

    Make sure MSDTC (Support Services / Distributed Transaction Coordinator) is started.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Connecting to sql server from Query Analizer

    First, your first post syntax is correct (I assume the comma between sa and Password is a typo, should be semi-colon). AFAIK there are only two reasons for the login...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: ORDER BY challenge

    select [col]

    from

    order by cast(

    (case when patindex('%[a-z]%',[col]) = 0

    then [col]

    else left([col],patindex('%[a-z]%',[col])-1)

    end) as int),[col]

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Load data and exclude What Already exists

    Generally I agree with you, the only difference is in the Merge Join, either a 'Right Outer Join' or 'Right Anti Semi Join'.

    It all depends on volume, the higher the...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Load data and exclude What Already exists

    INSERT INTO Exceptions

        (

        RecordType,

        CustCode,

        BalanceOutstanding,

        PastDue,

        CurrentDue,

        RepayAmount,

        SettlementAmount,

        DateApproved,

        LastPmtDate,

        LastPmtAmount

        ) 

    SELECT

        a.RecordType...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Question of the Day for 04 Nov 2004

    It's only easy when you know the answer

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Does table field allow nulls?

    Nice one Scott  , your right, I thought of that but only after I posted

    Even better...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Insert daily records from one table to individual merchant tables

    How many merchants are there?

    How long does the whole process take? (you state > 30 mins)

    Based on my last post, if there are 2,000 merchants and it takes 30 mins...

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 2,461 through 2,475 (of 3,544 total)