how to find/select min/max date ?

Options

 Hi all:

 There is probably a simple obvious answer to this, but right now it eludes me.  In RE, I want to see the earliest / first instance of a certain gift type, and  the last / final / most recent instance of same.   I don't care about constituent or campaign or marketing source or any other characteristics, just the first time and the last time a certain kind of donation was given.   SQL statement would be simple as

"Select Gift Type, Max (Gift Date) ,  Min (Gift Date) .... 

where Gift Type = "xxxxx"...."

 

I just want to identify the first and last time a gift type was made, that's it.

 

 

Comments

  • Mike Adams
    Mike Adams Blackbaud Employee
    Ancient Membership Facilitator 1 Name Dropper Photogenic
    Dave Billnitzer:

     Hi all:

     There is probably a simple obvious answer to this, but right now it eludes me.  In RE, I want to see the earliest / first instance of a certain gift type, and  the last / final / most recent instance of same.   I don't care about constituent or campaign or marketing source or any other characteristics, just the first time and the last time a certain kind of donation was given.   SQL statement would be simple as

    "Select Gift Type, Max (Gift Date) ,  Min (Gift Date) .... 

    where Gift Type = "xxxxx"...."

     

    I just want to identify the first and last time a gift type was made, that's it.

     

     

    Hi Dave!

    You could create a Gift Query and set the Tabs up this way:

    Criteria:

    Gift information>Gift Type equals [type in question]

    Output:

    Gift information>Gift Type

    Gift information>Gift Date

    Gift information>Gift Amount

    Sort:

    Gift information>Gift Date(Asc)

    When you click on Results, the top row will be the oldest instance of that Gift Type by Gift Date.  You can go back to the Criteria Tab and change the Gift Type to see the results for the next Gift Type.

    If you want to see the oldest Gift of a certain Type by the date it was added to the database instead of the Gift Date (in case someone adds a Gift and back-dates it), you could add Gift information>Date Added to the Output and change the Sort Tab to Gift information>Date Added (Asc).

    Hope this helps!

    Mike Adams

  • Mike Adams
    Mike Adams Blackbaud Employee
    Ancient Membership Facilitator 1 Name Dropper Photogenic
    Mike Adams:

    Hi Dave!

    You could create a Gift Query and set the Tabs up this way:

    Criteria:

    Gift information>Gift Type equals [type in question]

    Output:

    Gift information>Gift Type

    Gift information>Gift Date

    Gift information>Gift Amount

    Sort:

    Gift information>Gift Date(Asc)

    When you click on Results, the top row will be the oldest instance of that Gift Type by Gift Date.  You can go back to the Criteria Tab and change the Gift Type to see the results for the next Gift Type.

    If you want to see the oldest Gift of a certain Type by the date it was added to the database instead of the Gift Date (in case someone adds a Gift and back-dates it), you could add Gift information>Date Added to the Output and change the Sort Tab to Gift information>Date Added (Asc).

    Hope this helps!

    Mike Adams

    Hi Dave,

    To get the most recent instance of that Gift Type, jump to the bottom of the Query Results by clicking the arrow icon in the top left of the Results page that looks like this:

    >|

    That will skip you to the last row.

    Mike 

     

  • Mike Adams:

    Hi Dave,

    To get the most recent instance of that Gift Type, jump to the bottom of the Query Results by clicking the arrow icon in the top left of the Results page that looks like this:

    >|

    That will skip you to the last row.

    Mike 

     

     thanks Mike.

     I guess that's really the only way - it runs fast enough, I just assumed there would be  min/max selection or a first/last selection.    I'm too used to doing things like this in SQL language

Categories