<?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 — Problem in Insert SQL for Boolean [Solved]]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=8912</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=8912&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Problem in Insert SQL for Boolean [Solved].]]></description>
		<lastBuildDate>Tue, 09 Apr 2024 15:55:05 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Problem in Insert SQL for Boolean [Solved]]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50684#p50684</link>
			<description><![CDATA[<p><strong>Thanks after 10 Hours i have found a solution ...</strong></p>]]></description>
			<author><![CDATA[null@example.com (lara.0080)]]></author>
			<pubDate>Tue, 09 Apr 2024 15:55:05 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50684#p50684</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem in Insert SQL for Boolean [Solved]]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50680#p50680</link>
			<description><![CDATA[<div class="quotebox"><cite>tcoton wrote:</cite><blockquote><p>Boolean values are stored as 1 or 0 in the database, where do your valueasbooleanxxx come from?</p></blockquote></div><br /><p>if you take a look on this <br /></p><div class="codebox"><pre><code> if    StrToInt(form1.Edit2.Text) &lt;&gt; 0 then
           begin
             valueAsBoolean2 := true
           end else   valueAsBoolean2 := false   ;</code></pre></div><p><strong>if (editx.text) is not 0 this will give the valueAsBooleanx The true value..if it is&nbsp; 0 it will take false value&nbsp; ..</strong></p>]]></description>
			<author><![CDATA[null@example.com (lara.0080)]]></author>
			<pubDate>Tue, 09 Apr 2024 12:08:50 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50680#p50680</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem in Insert SQL for Boolean [Solved]]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50679#p50679</link>
			<description><![CDATA[<p>Boolean values are stored as 1 or 0 in the database, where do your valueasbooleanxxx come from?</p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Tue, 09 Apr 2024 11:52:43 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50679#p50679</guid>
		</item>
		<item>
			<title><![CDATA[Problem in Insert SQL for Boolean [Solved]]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50676#p50676</link>
			<description><![CDATA[<p><strong>Where is&nbsp; the problem ??? (why i can&#039;t&nbsp; give a Boolean value from variable to Boolean column!? )<br /></strong><br /></p><div class="codebox"><pre><code>empid : Integer;

    valueAsBoolean1,valueAsBoolean2,valueAsBoolean3,valueAsBoolean4,valueAsBoolean5,valueAsBoolean6,valueAsBoolean7,: boolean;

begin


empid := 3 ;

           if     StrToInt(form1.Edit1.Text) &lt;&gt; 0 then
           begin
             valueAsBoolean1 := true
           end else   valueAsBoolean1 := false  ;

           if    StrToInt(form1.Edit2.Text) &lt;&gt; 0 then
           begin
             valueAsBoolean2 := true
           end else   valueAsBoolean2 := false   ;

               if     StrToInt(form1.Edit3.Text) &lt;&gt; 0 then
           begin
             valueAsBoolean3 := true
           end else   valueAsBoolean3 := false ;

                if     StrToInt(form1.Edit4.Text) &lt;&gt; 0 then
           begin
             valueAsBoolean4 := true
           end else   valueAsBoolean4 := false    ;

       if     StrToInt(form1.Edit5.Text) &lt;&gt; 0 then
           begin
             valueAsBoolean5 := true
           end else   valueAsBoolean5 := false  ;

       if     StrToInt(form1.Edit6.Text) &lt;&gt; 0 then
           begin
             valueAsBoolean6 := true
           end else   valueAsBoolean6 := false   ;

       if     StrToInt(form1.Edit7.Text) &lt;&gt; 0 then
           begin
             valueAsBoolean7 := true
           end else   valueAsBoolean7 := false   ;



         SQLExecute(&#039;INSERT INTO Employ_Days (Id_empl, day1, day2, day3, day4, day5, day6, day7) VALUES (&quot;&#039;+empid +&#039;&quot;, &quot;&#039;+ valueAsBoolean1 + &#039;&quot; ,&quot;&#039; + valueAsBoolean2 + &#039;&quot;,&quot;&#039; + valueAsBoolean3 + &#039;&quot;,&quot;&#039; + valueAsBoolean4 + &#039;&quot;,&quot;&#039; + valueAsBoolean5 +&#039; &quot;,&quot;&#039; + valueAsBoolean6 + &#039;&quot;,&quot;&#039; +valueAsBoolean7+ &#039;&quot;)&#039;);
              form1.TableGrid1.dbUpdate;</code></pre></div><br /><br /><p><strong><br />Okay, I have boxes from 1 to 7 with values and names: edit1 - edit2 - edit3 - edit4 - edit5 - edit6 - edit7. I also have a table with the following columns holding true or false values (boolean variables): day1 - day2 - day3 - day4 - day5 - day6 - day7, and a foreign key from the Employees table called Id_Employ, and the name of the table is &#039;work_Days. I have a combobox to select the teacher. I want to check box 1, and if its value is greater than 0, I want to put a check mark in the column day1, and so on with the rest of the boxes and columns, all in one row, storing the Employ&#039;s key in Id_Employ.</strong></p>]]></description>
			<author><![CDATA[null@example.com (lara.0080)]]></author>
			<pubDate>Tue, 09 Apr 2024 10:07:42 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50676#p50676</guid>
		</item>
	</channel>
</rss>
