<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — How to include a calculated field in SQL]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=5961</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=5961&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in How to include a calculated field in SQL.]]></description>
		<lastBuildDate>Sun, 09 Feb 2020 18:49:20 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How to include a calculated field in SQL]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=34659#p34659</link>
			<description><![CDATA[<p>Thank you Derek,</p><p>As always such a simple solution.</p><p>At least it helps me understand how MVD works internally for future reference.</p>]]></description>
			<author><![CDATA[null@example.com (CDB)]]></author>
			<pubDate>Sun, 09 Feb 2020 18:49:20 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=34659#p34659</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to include a calculated field in SQL]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=34657#p34657</link>
			<description><![CDATA[<p>Hi,<br />I&#039;ve added request date and rec_date (both parsed) to the sqlquery button and it seems to be working okay.<br />Have a look at the attached.<br />Derek.</p>]]></description>
			<author><![CDATA[null@example.com (derek)]]></author>
			<pubDate>Sun, 09 Feb 2020 12:53:37 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=34657#p34657</guid>
		</item>
		<item>
			<title><![CDATA[How to include a calculated field in SQL]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=34652#p34652</link>
			<description><![CDATA[<p>I&#039;m a little stuck, I have a database which has some calculated fields for dates.</p><p>I have written a SQL query and want to reference the calculated field that I have created in MVD.</p><p>My calculated fields <span style="color: RED">cfDateRec</span> and <span style="color: BLUE">cfDateReq</span> (which work when I let MVD do all the work) is:</p><div class="codebox"><pre><code>strftime(&#039;%d &#039;, rec_date)||(substr(&quot;--JanFebMarAprMayJunJulAugSepOctNovDec&quot;,strftime(&#039;%m&#039;, rec_date)*3,3)|| strftime(&#039; %Y&#039;, rec_date))</code></pre></div><p>.</p><p>The SQL I have so far in the search function is.</p><div class="codebox"><pre><code>SELECT
a.tech,
b.sup_name,
c.part, 
c.requestdate,
c.rec_date

FROM
techname a, supplier b, requests c 

WHERE 
c.id_techname = a.id  AND
c.id_supplier = b.id  AND 
((a.tech LIKE &#039;%{edtSearch}%&#039;) OR
(b.sup_name LIKE &#039;%{edtSearch}%&#039;) OR
(c.part LIKE &#039;%{edtSearch}%&#039;)); </code></pre></div><p>I am hoping to parse c.requestdate and c.rec_date through the above Pascal calculated field.</p><p>I have tried letting MVD to do all the work using the &#039;Search&#039; action from a button, but this fails as it keeps inserting a &#039;.&#039; in the WHERE clause which makes the whole thing fail.</p><p>I can post the project if that helps.</p>]]></description>
			<author><![CDATA[null@example.com (CDB)]]></author>
			<pubDate>Sun, 09 Feb 2020 08:19:44 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=34652#p34652</guid>
		</item>
	</channel>
</rss>
