Forum Replies Created

Viewing 15 posts - 1 through 15 (of 27 total)

  • Reply To: Help on excluding dates

    SELECT

    A.Context

    , A.CName

    , A.OutsideId

    , DATEADD(hour,-5,A.CompletedOn) AS PostedDate

    FROM Audit A

    INNERJOIN

    (WITH PostedHistory AS

    (

    SELECT

    a.DealId

    ,       MAX(a.CompletedOn) as LastDate

    ,       DATEADD(DAY, -3, MAX(a.CompletedOn) OVER()) AS CutoffDate

    FROMAudit a

    WHERE a.DisplayName = 'TestFloor'

    AND a.Status...

  • Reply To: Help on excluding dates

    Thanks for that, guys!  That does work for getting the results I need from that part of my query.  I'm joining these results into a larger data set via an...

  • Reply To: Need help on a query, not sure if PIVOT is what I need to use

    Nice!  Some of that is a bit over my head, but it does work!  I'm going to have to really dig in to that solution to better understand it!  Thanks,...

  • Reply To: Need help on a query, not sure if PIVOT is what I need to use

    Ah, yes... that did it.  Sorry, I should have caught that!  Many thanks for the assistance!

  • Reply To: Need help on a query, not sure if PIVOT is what I need to use

    Thanks for this!  I'm not sure what I'm doing wrong, but it's not liking the dates as columns.  They're all producing errors as such:

    Msg 207, Level 16, State 1, Line...

  • RE: SQL Query Help

    My apologies, I think I misstated what results I was looking for.  I just want GUIDs that DON'T have a FieldName = 'Reason.Reason'

  • RE: SQL Query Help

    That's exactly right.  THose are the 2 ID's I want to return.  But when I change to != from = I get 0 results again.  My apologies, I think I...

  • RE: SQL Query Help

    That's exactly right.  THose are the 2 ID's I want to return.  But when I change to != from = I get 0 results again.

  • RE: SQL Query Help

    Well, that brings back the 3 rows that have reason.reason.  i want/need to return the ones that don't have FieldName = 'Reason.Reason'.

  • RE: SQL Query Help

    Tried that with my sample data, but get 0 results:

    select a.id
    from #temp_data a
    where not exists (select * from #temp_data b where a.id = b.id and...

  • RE: SQL Query Help

    Here's a sample data set... my result set would be the following GUIDs that don't have at least 1 instance of 'reason.reason':

    5B82C628-2FA5-4A97-A665-001476DCBB9E
    E1CF3C1C-7DDA-4006-820C-001748BEC17F
    7BCD51C2-4494-401A-82BD-002A18AB3B07
    O9DE7318-5739-4617-84DB-00A106DE3E3E

    The other...

  • RE: Getting max(date) and relevant unique GUID

    Thank, Guys.  I'll give both a shot.  Side note:  I'm using a single cust_id to validate my data... would both of these solutions work with multiple cust_id's?

  • RE: DateDiffs across multiple rows in a dataset

    Lynn,

    Understand about the protocol. Thanks for the clarification! I'll be sure to adhere to the process in the future if needed.

    The sql you provided was exactly what I...

  • RE: DateDiffs across multiple rows in a dataset

    Looking for a new column with the difference between most recent and it's predecessor. A dataset such as this:

    CustomerID, CustomerName, AuditNum, AuditDate, DateDiff

    11111, Cust1, 1, 2015-10-01, 0

    11112, Cust2, 1,...

  • RE: Average of time between multiple dates

    Many thanks, guys! Both seemed to work for what I needed!

Viewing 15 posts - 1 through 15 (of 27 total)