Forum Replies Created

Viewing 15 posts - 1,276 through 1,290 (of 3,500 total)

  • RE: List event with date range

    What do you mean by "nearest to today"? Can be either before or after?  Then you'd have to do MIN of ABS(DATEDIFF....)  or return the top 1 value...

  • RE: Need help with the getting a top 1 record with in a table with same ids

    You shouldn't be grouping by EventDate - you're trying to return a MIN([EventDate]), so grouping by it (return each unique value) doesn't make sense.

  • RE: Joining on the numeric part of string...

    If you have control over the design of the table, you could create a new column and extract just that part to the new column. Then you could index it...

  • RE: Calculate timespan between datetime field in multiple records

    Could you post some sample data - insert statements so we have something to work with? Basically, you can use LAG with a window to get the "previous" record, and...

  • RE: T-SQL help needed to eliminate duplicates from table

    Maybe this?
    SELECT member,
        amt_paid,
        amt_adjusted,
        dt,
        dupeNum
    FROM
    ( SELECT member,
        amt_paid,
        amt_adjusted,
        dt,
        ROW_NUMBER() OVER (PARTITION BY member, dt, amt_adjusted ORDER BY member, dt) AS dupeNum

  • RE: T-SQL help needed to eliminate duplicates from table

    mw_sql_developer - Monday, June 11, 2018 9:46 AM

    pietlinden - Sunday, June 10, 2018 5:08 PM

  • RE: T-SQL help needed to eliminate duplicates from table

    Kinda would help if I wrote an actual delete query... =)
    Test the CTE out by doing SELECT from it first instead of DELETE
    ;WITH
        cteMembers(member, amt_paid,...

  • RE: Export to Excel

    jagjitsingh - Sunday, June 10, 2018 2:50 AM

    Hi
     I want Data from the Sql table to Excel in predefined Excel Template . I...

  • RE: T-SQL help needed to eliminate duplicates from table

    Like this? It's not super clear what you want. In this case, a sample expected result would be a big help.  Something like this?
    Create table #t( member...

  • RE: Query

    jagjitsingh - Sunday, May 27, 2018 10:44 AM

    Hi

      I have below Data .

  • RE: How do you keep yourself from burning out?

    I agree with the "do something that's engrossing that's totally outside of work" - I did that and it kept me sane. Work was crazy, so I'd spend like 15...

  • RE: simple select * from table takes around 15 secons

    Thom A - Thursday, May 17, 2018 11:24 AM

    pietlinden - Thursday, May 17, 2018 11:22 AM

    May 17, 2018 at 11:54 am

    #1990904

  • RE: simple select * from table takes around 15 secons

    if you look in a phone book for everybody with "S" as the second letter of their last name, an index is meaningless, because a phone book is organized alphabetically....

  • RE: Checking Fulfillment of Prerequisites That Can Contain Elaborate AND/OR Relationships

    I really shouldn't take the bait...

    If you create the prerequisites table, this isn't too hard. I still am not totally clear on how you group ORs.  How would...

  • Viewing 15 posts - 1,276 through 1,290 (of 3,500 total)