Forum Replies Created

Viewing 15 posts - 31 through 45 (of 395 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, 5 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?

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