<?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 — any idea for count queries]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=8889</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=8889&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in any idea for count queries.]]></description>
		<lastBuildDate>Mon, 18 Mar 2024 12:38:17 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: any idea for count queries]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50526#p50526</link>
			<description><![CDATA[<p>Please keep ids as integer type in the database as that is what it indeed is especially for auto increment. Sometimes, in some querys you might need to transform an integer to string and vice versa which can be accomplished by using strtoint(your field here) or inttostr(your field here). That is especially true with sqlite when comparing data in the same query that must match a certain type.</p><p>What would help is to have the real error message as « the code does not work » is vague. To help you further, when a sql error is produced in MVD you can display the query to see where the error is.</p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Mon, 18 Mar 2024 12:38:17 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50526#p50526</guid>
		</item>
		<item>
			<title><![CDATA[Re: any idea for count queries]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50525#p50525</link>
			<description><![CDATA[<p>The SQLExecute function has the form </p><div class="codebox"><pre><code>SQLExecute( &#039; SELECT ....  &#039; );</code></pre></div><p> sqlDate -&nbsp; Returns the date value of the component for use in SQL queries. The property value already contains escape quotes. In the case of an empty value, it will return NULL.<br /></p><div class="codebox"><pre><code>example:  SQLExecute (&#039;INSERT INTO tablename (fieldname) VALUES ( &#039; + Form1.DateTimePicker1.sqlDate + &#039; )&#039;);</code></pre></div><p>sqlValue - Returns the id of the selected record in the component, for use in SQL queries. In case of empty value, it returns NULL string. The property value already contains escape quotes.<br /></p><div class="codebox"><pre><code>example: SQLExecute(&#039;INSERT INTO tablename (fieldname) VALUES ( &#039; + Form1.ComboBox1.sqlValue + &#039; )&#039;);.</code></pre></div><p>The use of CAST is not required.<br />Requires familiarity with MVD, SQLite.</p><p><a href="https://myvisualdatabase.com/help_en/ComponentPropertiesMethodsandEve.html">https://myvisualdatabase.com/help_en/Co … ndEve.html</a></p><p><a href="https://www.sqlite.org/index.html">https://www.sqlite.org/index.html</a></p><p><a href="https://myvisualdatabase.com/forum/viewtopic.php?pid=50515">https://myvisualdatabase.com/forum/view … ?pid=50515</a></p><p><a href="https://myvisualdatabase.com/forum/viewtopic.php?pid=50517">https://myvisualdatabase.com/forum/view … ?pid=50517</a></p>]]></description>
			<author><![CDATA[null@example.com (sparrow)]]></author>
			<pubDate>Mon, 18 Mar 2024 11:08:43 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50525#p50525</guid>
		</item>
		<item>
			<title><![CDATA[any idea for count queries]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50524#p50524</link>
			<description><![CDATA[<p>i have this query</p><div class="codebox"><pre><code>if SQLExecute(&quot;SELECT COUNT(*) FROM student WHERE date = &#039;&quot; + student.DateTimePicker1.sqlDate + &quot;&#039; AND id_Teachers = CAST(&#039;&quot; + student.ComboBox1.sqlValue + &quot;&#039; AS INTEGER)&quot;) &lt;&gt; 0 then</code></pre></div><p>here I want to check the date if this date is already available for specific teacher for that I used </p><div class="codebox"><pre><code>id_Teachers = CAST(&#039;&quot; + student.ComboBox1.sqlValue + &quot;&#039; AS INTEGER)&quot;</code></pre></div><p> to check only if the date is available for that teacher (id_Teachers) and this is a forging key ,<strong> but the code is not working ! any idea please …</strong></p><p>I have changed the student.ComboBox1.sqlValue&nbsp; to integer as I see that it is a string .</p>]]></description>
			<author><![CDATA[null@example.com (samtorn)]]></author>
			<pubDate>Mon, 18 Mar 2024 10:28:28 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50524#p50524</guid>
		</item>
	</channel>
</rss>
