<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error when retrieving data from a recordset in Archive</title>
    <link>https://business.forums.bt.com/t5/Archive/Error-when-retrieving-data-from-a-recordset/m-p/46252#M14672</link>
    <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;My query looks like this&lt;BR /&gt;&lt;BR /&gt;&amp;lt;%&lt;BR /&gt;&amp;nbsp; &amp;nbsp; SQLQuery2 = "SELECT Gift.Name AS Name, Gift.Description AS Description, Gift.QuantityDesired AS QuantityDesired, SUM(GiftGuest.QuantityGiven) AS QuantityGiven FROM Gift LEFT JOIN GiftGuest ON Gift.GiftID = GiftGuest.GiftID GROUP BY Gift.GiftID"&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Set RSGiftList = OBJdbConnection.Execute(SQLQuery2)&lt;BR /&gt;%&amp;gt;&lt;BR /&gt;&lt;BR /&gt;I'd like to display the information in the recordset the same way it's displayed when I run this query in php admin -- except that rather than display "null" if QuantityGiven is null, I'd like to display "none".&lt;BR /&gt;&lt;BR /&gt;What happens, though, is that if I loop through the recordset and display all the information in the recordset _except_ QuantityGiven, everything is fine. As soon as I put &amp;lt;%= RSGiftList("QuantityGiven") %&amp;gt; anywhere in the page, though, I just get an error message in the browser. &amp;nbsp;I've tried&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;% IF RSGiftList("QuantityGiven") IS NULL or RSGiftList("QuantityGiven") = "" or RSGiftList("QuantityGiven")= null THEN %&amp;gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; none&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;%ELSE %&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;lt;%= RSGiftList("QuantityGiven") %&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;%END IF%&amp;gt;&lt;BR /&gt;&lt;BR /&gt;With this code I still get the error &amp;nbsp;in the browser.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What am I doing wrong? Is there a better way to structure the query?&lt;BR /&gt;&lt;BR /&gt;Thank you for your help&lt;/P&gt;&lt;DIV&gt;&lt;IMG src="http://imagicon.info/cat/12-1/text-smiley.png" /&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 09 Oct 2012 16:48:41 GMT</pubDate>
    <dc:creator>orthohin</dc:creator>
    <dc:date>2012-10-09T16:48:41Z</dc:date>
    <item>
      <title>Error when retrieving data from a recordset</title>
      <link>https://business.forums.bt.com/t5/Archive/Error-when-retrieving-data-from-a-recordset/m-p/46252#M14672</link>
      <description>&lt;P&gt;Hello everyone,&lt;BR /&gt;My query looks like this&lt;BR /&gt;&lt;BR /&gt;&amp;lt;%&lt;BR /&gt;&amp;nbsp; &amp;nbsp; SQLQuery2 = "SELECT Gift.Name AS Name, Gift.Description AS Description, Gift.QuantityDesired AS QuantityDesired, SUM(GiftGuest.QuantityGiven) AS QuantityGiven FROM Gift LEFT JOIN GiftGuest ON Gift.GiftID = GiftGuest.GiftID GROUP BY Gift.GiftID"&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Set RSGiftList = OBJdbConnection.Execute(SQLQuery2)&lt;BR /&gt;%&amp;gt;&lt;BR /&gt;&lt;BR /&gt;I'd like to display the information in the recordset the same way it's displayed when I run this query in php admin -- except that rather than display "null" if QuantityGiven is null, I'd like to display "none".&lt;BR /&gt;&lt;BR /&gt;What happens, though, is that if I loop through the recordset and display all the information in the recordset _except_ QuantityGiven, everything is fine. As soon as I put &amp;lt;%= RSGiftList("QuantityGiven") %&amp;gt; anywhere in the page, though, I just get an error message in the browser. &amp;nbsp;I've tried&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;% IF RSGiftList("QuantityGiven") IS NULL or RSGiftList("QuantityGiven") = "" or RSGiftList("QuantityGiven")= null THEN %&amp;gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; none&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;%ELSE %&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;lt;%= RSGiftList("QuantityGiven") %&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;%END IF%&amp;gt;&lt;BR /&gt;&lt;BR /&gt;With this code I still get the error &amp;nbsp;in the browser.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What am I doing wrong? Is there a better way to structure the query?&lt;BR /&gt;&lt;BR /&gt;Thank you for your help&lt;/P&gt;&lt;DIV&gt;&lt;IMG src="http://imagicon.info/cat/12-1/text-smiley.png" /&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 09 Oct 2012 16:48:41 GMT</pubDate>
      <guid>https://business.forums.bt.com/t5/Archive/Error-when-retrieving-data-from-a-recordset/m-p/46252#M14672</guid>
      <dc:creator>orthohin</dc:creator>
      <dc:date>2012-10-09T16:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error when retrieving data from a recordset</title>
      <link>https://business.forums.bt.com/t5/Archive/Error-when-retrieving-data-from-a-recordset/m-p/46296#M14673</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note sure why you get the first error, but the second...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Aren't you trying to put a string into an integer?&amp;nbsp; Null can be used for any variable, but if your QuantityGiven is an integer then trying to put 'None' into it won't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just a thought.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2012 12:42:59 GMT</pubDate>
      <guid>https://business.forums.bt.com/t5/Archive/Error-when-retrieving-data-from-a-recordset/m-p/46296#M14673</guid>
      <dc:creator>DaveA</dc:creator>
      <dc:date>2012-10-10T12:42:59Z</dc:date>
    </item>
  </channel>
</rss>

