Forum Replies Created

Viewing 15 posts - 5,071 through 5,085 (of 6,036 total)

  • RE: Select the biggest value

    Jeff, you don't need any special function.

    I'm sure you've got our favourite "split" function.

    Concatenate as many values as you need (starting from no values) into delimited string and select MAX...

  • RE: Select the biggest value

    You always welcome, Jeff.

    When I've been asked (or I am asking ) for something what is...

  • RE: Select the biggest value

    There is an inbuilt function for that.

    It's "MAX". It's strange you did not know about that.

    Actually TSQL is a language to deal...

  • RE: Creating text files for each row of the ouput

    User "sa" does not exist is OS environment.

    Check out which user starts SQL Server service on your machine. And make sure that user can access that folder.

  • RE: Prorating no of units

    Mita,

    Probably you don't need report from all 14 mil rows every day.

    You must be interested in service records for some period of time.

    If you have set up clustered index on...

  • RE: Alternative to using DISTINCT with COUNT Function

    Simple solution is proper database design.

    You suppose to have separate table with unique identfiers for your "QuestionTree"s.

    Probably you have, if you reference QuestionTreeUID.

    Then you select COUNT(*) from that table WHERE...

  • RE: Compare values to a mask on table

    Did you test it?

    DECLARE @Value nvarchar(50)

    DECLARE @Mask nvarchar(50)

    SET @Value = '150000'

    SET @Mask = '1##5##'

    SELECT 'OOOOOPS!', 'Value "' + @Value + '" is consistant with mask "' + @Mask + '"',...

  • RE: Help with Query Design?

    select StaffDetails.[Employee],

    ISNULL(SUM(InvoiceTotals.[Total Net]), 0) AS TotalNet,

    ISNULL(SUM(InvoiceTotals.[Total CostBC]), 0) AS TotalCost

    from StaffDetails

    Left Join InvoiceTotals on InvoiceTotals.[Nominal Code] = StaffDetails.[Nominal Code] and (InvoiceTotals.[Invoice Date] between '15/09/2006' and '15/09/2006')

    where StaffDetails.Active ='Y' and...

  • RE: Removing "The" from the beginning of strings.

    You do not need IN even for INNER JOIN query:

    update T

    set ColumnName = SUBSTRING(T.ColumnName , 5, (LEN(T.ColumnName)-4))

    FROM Table T

    INNER JOIN ....

    where T.ColumnName like 'the %'

  • RE: Removing "The" from the beginning of strings.

    Do not overcomplicate your queries.

    This will be fine:

    update Table

    set ColumnName = SUBSTRING(ColumnName , 5, (LEN(ColumnName)-4))

    where ColumnName like 'the %'

  • RE: Compare values to a mask on table

    Happy for you, guys, but that solution is wrong.

    Mask '1##5##' will match all these: '125235', '123451', '151111', '100005', etc.

    Why not open BOL on topic "LIKE" and find this:

  • RE: Help in BCP

    ND, you are wrong. I use to create reports by direct call of SP from bcp. It's really flexible and manageble way. Recommend to try.

    Ramesh, your bcp call is incomplete....

  • RE: osql output to txt file on local station

    So, you run the command on server. In server environment. With all its sequrity rights.

    And what you expect?

    What you are trying to do is calling your local town phone number...

  • RE: osql output to txt file on local station

    On which machine do you run your osql command?

  • RE: Time Span Help

    Start here:

    CREATE TABLE [dbo].[Inp_Stay] (

     [MemberID] [char] (22) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,

     [Product] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,

     [Provider] [int] NOT NULL ,

     [Admit] SMALLDATETIME NOT NULL ,

     [Discharge]

  • Viewing 15 posts - 5,071 through 5,085 (of 6,036 total)