Last Gift Amount and Max Gift Date

Hello, 

I am working on some Output set elements for our Dev team and I have come a little stuck and I thought someone must have created these already...

I have managed to get the largest contribution amount but can't seem to get the corresponding date to output.

Also,

I have the last contribution date but not the amount. 

Thank you, 

Kelly

Parents
  • I believe it is in the output set cookbook. I would look there. If not I can post it up for you.

     

    Travis

  • I've had a look in the Cookbook and they didn't seem quite what I was after. 

    There is one that looks at last cont to a specific Campaign - I'll have a look at amending that, but I was sure someone would have done that already. Being a little lazy. 

    Kelly

  • Here is a view that will get you going. If need more let me know.

     

    USE [impresario]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    create view [dbo].[lv_largest_gift]
    as

    /*****************************************************************************
    created 5/17/2011 tla
    select largest gift for output builder
    select * from lv_largest_gift
    ******************************************************************************/

    SELECT
    customer_no,
    max(cont_amt) as largest_cont_amt,
    max(cont_dt) AS largest_cont_amt_dt

    from t_contribution a

    Where a.cont_amt =(select max(cont_amt) from t_contribution b where a.customer_no = b.customer_no)

    GROUP BY a.customer_no


    GO
    grant select on [lv_largest_gift]  to impusers
    GO

Reply
  • Here is a view that will get you going. If need more let me know.

     

    USE [impresario]
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    create view [dbo].[lv_largest_gift]
    as

    /*****************************************************************************
    created 5/17/2011 tla
    select largest gift for output builder
    select * from lv_largest_gift
    ******************************************************************************/

    SELECT
    customer_no,
    max(cont_amt) as largest_cont_amt,
    max(cont_dt) AS largest_cont_amt_dt

    from t_contribution a

    Where a.cont_amt =(select max(cont_amt) from t_contribution b where a.customer_no = b.customer_no)

    GROUP BY a.customer_no


    GO
    grant select on [lv_largest_gift]  to impusers
    GO

Children