Forum Replies Created

Viewing 15 posts - 31 through 45 (of 392 total)

  • Reply To: Problem understanding SUM function with GROUP BY

    Sorry... I see now and tried MAX and that took care of it... thanks!!

  • Reply To: Problem understanding SUM function with GROUP BY

    This does not seem to work, the data returns like before:

    SELECT [user_name], [created_at],
    SUM(dbo.fnGetDecimalTime([event_sec])) as 'Decimal_Time_SUM'
    FROM [Charter].[dbo].[ConvoHrs]
    group by [user_name],[created_at]
    order by [user_name]

    • This reply was modified 4 years, 3 months ago by DaveBriCam.
  • Reply To: Problem understanding SUM function with GROUP BY

    Thanks! One thing what if I need to add a field like [Date] (which I may want to do grouping on later)? It wants this added to the 'group by'...

  • Reply To: best way to extract name and number

    I can get the full name with this:

    ,LTRIM(RTRIM(SUBSTRING([user_name], CHARINDEX(')', [user_name]) + 1, 
    PATINDEX('%[+-][0-9]%', [user_name]) - (CHARINDEX(')', [user_name]) + 1))))
  • Reply To: Query removing NULLs when not chosen to

    That works and makes sense! Thanks!

  • Reply To: problem with UNION ALL query

    This is working:

    SELECT * FROM (SELECT 
    c.clientname as 'Client',
    c.BillingRateA as 'Rate',
    b.BillingTypeA as 'Unit',
    ...
  • Reply To: problem with UNION ALL query

    Both BillingRateA and BillingRateB are decimal

    CREATE TABLE [dbo].[Client](
    [ClientID] [int] IDENTITY(1,1) NOT NULL,
    [ClientName] [varchar](50) NOT NULL,
    [MarketSegmentID] [int] NULL,
    [BillingTypeA] [int] NULL,
    [BillingRateA] [decimal](8, 2) NULL,
    [BillingTypeB] [int] NULL,
    [BillingRateB] [decimal](8, 2) NULL,

  • Reply To: problem with UNION ALL query

    Her is what I am getting:

     

     

  • Reply To: problem with UNION ALL query

    BillingRateB and BillinRateA are decimal. 49 rows are returned and there are 41 records in the table of which 8 in question do have a BillingRateB (and BillingRateA), but all...

  • Reply To: Subquery issue in PIVOT

    How can I pass in the date as a variable in the dynamic part of the SQL?:

    --below is close but not working:

    declare
    @ColumnNames nvarchar(max),
    ...
  • Reply To: Update table FirstName & LastName from Email addresses

    What is the code for the function DelimitedSplit8K?

  • Reply To: Update table FirstName & LastName from Email addresses

    This less than eloquent way works until I get a name like (t) Robert Hester -15421 :

    Select Ltrim(SubString([agent name],1,Isnull(Nullif(CHARINDEX(' ',[agent name]),0),1000))) As FirstName,
    Ltrim(SUBSTRING([agent name],CharIndex(' ',[agent name]),
    Case When...

    • This reply was modified 4 years, 4 months ago by DaveBriCam.
  • Reply To: Update table FirstName & LastName from Email addresses

    The last name is always the 2nd spot and the first is always the first sport and the employee number is always the number after the dash.

  • Reply To: Update table FirstName & LastName from Email addresses

    I have a different set of data on which I want to use PARSENAME:

    Jamie Pourhussin (WTA) -692

    Brenda Johnson -11337

    Delia Rosenstiel -11256

    Rodderick Douglas LD051121 -13224

    Tynesha Townsend -14014

    Mikala Fenner -12881

    I can get...

  • Viewing 15 posts - 31 through 45 (of 392 total)