<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.tntware.com/donorwise/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Where can I find a listing of tables and fields that I can query in the "Run Query" feature?</title><link>https://www.tntware.com/donorwise/faqs/en/where-can-i-find-a-listing-of-tables-and-fields-that-i-can-query-in-the-quot-run-query-quot-feature.aspx</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Debug Build: 40407.4157)</generator><item><title>Where can I find a listing of tables and fields that I can query in the "Run Query" feature?</title><link>https://www.tntware.com/donorwise/faqs/en/where-can-i-find-a-listing-of-tables-and-fields-that-i-can-query-in-the-quot-run-query-quot-feature.aspx</link><pubDate>Wed, 06 Jan 2021 21:49:37 GMT</pubDate><guid isPermaLink="false">de06579a-5120-4393-a24b-6f68f5e7a3ec:30</guid><dc:creator>Troy Wolbrink</dc:creator><comments>https://www.tntware.com/donorwise/faqs/en/where-can-i-find-a-listing-of-tables-and-fields-that-i-can-query-in-the-quot-run-query-quot-feature/comments.aspx</comments><description>Current revision posted to Frequently Asked Questions by Troy Wolbrink on 1/6/2021 9:49:37 PM&lt;br /&gt;
&lt;p&gt;Most of DonorWise is well documented, but the &amp;quot;Run Query&amp;quot; feature (under the &amp;quot;Tools&amp;quot; menu) is a power-user feature that&amp;#39;s more of an &amp;quot;explore on your own&amp;quot; feature.&amp;nbsp; To use this feature, the power-user needs to learn some basic SQL (structured query language).&amp;nbsp; More specifically it&amp;#39;s T-SQL, the SQL Server variant.&lt;/p&gt;
&lt;p&gt;The quickest way to start exploring this feature is by clicking the &amp;quot;Fields&amp;quot; button.&amp;nbsp; This cuases a list of tables you can query appear to the left.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.tntware.com/donorwise/cfs-file.ashx/__key/CommunityServer.Wikis.Components.Files/en/7120.run-query-fields.png"&gt;&lt;img src="https://www.tntware.com/donorwise/cfs-filesystemfile.ashx/__key/CommunityServer.Components.ImageFileViewer/CommunityServer.Wikis.Components.Files.en/7120.run-query-fields.png_2D00_550x0.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can click on a table name to see that table&amp;#39;s fields.&lt;/p&gt;
&lt;p&gt;The most common table (technically a &amp;quot;view&amp;quot; not a &amp;quot;table&amp;quot;) you&amp;#39;d query is &lt;strong&gt;GiftDonationView&lt;/strong&gt;. This contains every approved donation, including reversals and corrections.&lt;/p&gt;
&lt;p&gt;For example, to query the 100 most recent donations, you&amp;#39;d run a query like this:&lt;/p&gt;
&lt;table style="border-collapse:collapse;width:100%;" border="1"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="width:100%;"&gt;SELECT TOP 100 * FROM GiftDonationView ORDER BY ReceivedDate DESC&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;GiftDonation&lt;span style="background-color:#ffff99;"&gt;Actual&lt;/span&gt;View&lt;/strong&gt;&amp;nbsp;might be a better view to run queries on as it only contains the final state of a donation/gift ... after any reversals and corrections.&amp;nbsp; Let&amp;#39;s say a gift was posted, then reversed and corrected, and then reversed and corrected again.&amp;nbsp; The &amp;quot;actual&amp;quot; view will only show the final state of the gift and not the entire correction history.&amp;nbsp; So unless you want the entire correction history, this might be the best view to use.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;strong&gt;GiftDonationRawView&lt;/strong&gt;&amp;nbsp;is the same as GiftDonationView, except that it includes donations that are not yet approved.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>