Skip to content

Instantly share code, notes, and snippets.

@tinaarnoldi
tinaarnoldi / google-apps-script.md
Created October 24, 2017 17:16 — forked from labnol/google-apps-script.md
The best resources for learning Google Apps Script, the glue that connects various Google services including Gmail, Google Drive, Calendar, Maps, Analytics and more.
@tinaarnoldi
tinaarnoldi / SQL Raisers Edge Gifts to specific fund
Created July 9, 2012 16:51
SQL Raisers Edge Gifts to specific fund
SELECT
GIFT.CONSTIT_ID, GIFT.Amount, GIFT.DTE, FUND.FUND_ID, RECORDS.FIRST_NAME, RECORDS.LAST_NAME, RECORDS.ORG_NAME, GIFT.REF
FROM
RECORDS LEFT OUTER JOIN
GIFT LEFT OUTER JOIN
FUND INNER JOIN
GiftSplit ON FUND.ID = GiftSplit.FundId ON GIFT.ID = GiftSplit.GiftId ON RECORDS.ID = GIFT.CONSTIT_ID
WHERE (FUND.FUND_ID = 'YOUR PROJECT ID OR FUND ID') AND (GIFT.DTE >= @Date)
@tinaarnoldi
tinaarnoldi / SQL Grantedge Combine Fields into 1 TextBox Expression
Created July 9, 2012 16:48
SQL Grantedge Combine Fields into 1 TextBox Expression
=Fields!FundNumber.Value & " " & Fields!FundName.Value
@tinaarnoldi
tinaarnoldi / SQL Grantedge Payment amount vs Grant amount
Created July 9, 2012 16:40
SQL Grantedge Payment amount vs Grant amount
SELECT DISTINCT
V_GRRPT_PAYMENTS.PayDate AS GrantDate, V_GRRPT_Grants.RecipientName, V_GRRPT_Grants.PayeeName, V_GRRPT_Grants.GrantType,
V_GRRPT_Grants.GrantStatus, V_GRRPT_Grants.PaymentAmount AS GrantAmount, V_GRRPT_PAYMENTS.PayDate AS DatePaid,
V_GRRPT_PAYMENTS.TotalAmount AS PaymentAmount, V_GRRPT_PAYMENTS.PayStatus, V_GRRPT_PAYMENTS.CheckNumber, V_GRRPT_PAYMENTS.CheckDate,
V_GRRPT_PAYMENTS.AdjustmentAmount, V_GRRPT_CCF_GrantCharacteristics_TOPLEVELPROGRAM.TopLevelProgramArea, V_GRRPT_PAYMENTS.FundNumber,
V_GRRPT_PAYMENTS.FundName, V_GRRPT_PAYMENTS.GrantId
FROM
V_GRRPT_CCF_GrantCharacteristics_TOPLEVELPROGRAM RIGHT OUTER JOIN
V_GRRPT_PAYMENTS ON V_GRRPT_CCF_GrantCharacteristics_TOPLEVELPROGRAM.GrantId = V_GRRPT_PAYMENTS.GrantId LEFT OUTER JOIN
@tinaarnoldi
tinaarnoldi / gist:3077485
Created July 9, 2012 16:34
SQL Grantedge Grants by Geo Area for previous week
SELECT DISTINCT
V_GRRPT_Grants.GrantId, V_GRRPT_Grants.PayDate AS GrantDate, V_GRRPT_Grants.FundNumber, V_GRRPT_Grants.FundName, V_GRRPT_Grants.RecipientName,
V_GRRPT_Grants.GrantType, V_GRRPT_Grants.GrantStatus, V_GRRPT_Grants.PaymentAmount AS GrantAmount, V_GRRPT_PAYMENTS.PayDate AS DatePaid,
V_GRRPT_PAYMENTS.TotalAmount AS PaymentAmount, V_GRRPT_PAYMENTS.PayStatus, V_GRRPT_PAYMENTS.CheckNumber, V_GRRPT_PAYMENTS.CheckDate,
V_GRRPT_PAYMENTS.AdjustmentAmount, V_GRRPT_CCF_GrantCharacteristics_TOPLEVELPROGRAM.TopLevelProgramArea, V_GRQRY_GrantCharacteristics.Name,
V_GRQRY_GrantCharacteristics.CodeValue AS Expr2
FROM
V_GRRPT_Grants INNER JOIN
V_GRRPT_PAYMENTS ON V_GRRPT_PAYMENTS.GrantId = V_GRRPT_Grants.GrantId LEFT OUTER JOIN
@tinaarnoldi
tinaarnoldi / SQL Grantedge Donor Giving History by Field of Interest
Created July 9, 2012 16:25
SQL Grantedge Donor Giving History by Field of Interest
SELECT
Grants.GrantId, Grants.PayDate AS GrantDate, Grants.FundNumber, Grants.FundName, Grants.RecipientName, Grants.PayeeName, Grants.GrantType,
Grants.GrantStatus, Grants.PaymentAmount AS GrantAmount, Payments.PayDate AS DatePaid, Payments.TotalAmount AS PaymentAmount, Payments.PayStatus,
Payments.CheckNumber, Payments.CheckDate, Payments.AdjustmentAmount, TL.TopLevelProgramArea, Grants.RecipientCity, WS.Email,
(CASE WHEN Grants.PayDate >= '20050701' AND Grants.PayDate < '20060630' THEN Grants.PaymentAmount ELSE 0 END) AS FY2006,
(CASE WHEN Grants.PayDate >= '20060701' AND Grants.PayDate < '20070630' THEN Grants.PaymentAmount ELSE 0 END) AS FY2007,
(CASE WHEN Grants.PayDate >= '20070701' AND Grants.PayDate < '20080630' THEN Grants.PaymentAmount ELSE 0 END) AS FY2008,
(CASE WHEN Grants.PayDate >= '20080701' AND Grants.PayDate < '20090630' THEN Grants.PaymentAmount ELSE 0 END) AS FY2009,
@tinaarnoldi
tinaarnoldi / gist:3077404
Created July 9, 2012 16:17
SQL Grantedge exclude transfers from grant type
HAVING (Grants.GrantType <> 't')
@tinaarnoldi
tinaarnoldi / gist:3077351
Created July 9, 2012 16:03
SQL Grantedge Assigning fiscal year to specified date range.
(Case when grants.paydate >= ‘20050701’ and grants.paydate < ‘20060603’ then grants.paymentamount else 0 red) as FY2006
@tinaarnoldi
tinaarnoldi / gist:3077339
Created July 9, 2012 16:03
SQL Grantedge Parameter value for date 7 days prior
=DateAdd(DateInterval.Day, -7, (Today))