Rob,

We have gone a different direction to achieve what we were trying to do.

However, I’ll re-test this following the advice you’re giving here.

My desire is to use the code
>> $iSQLStatement:=MySQL New SQL Statement ($iSQLConnection;"SELECT 
>> contactLogin FROM Contacts WHERE reset_password_token_created_at<=?;")
>> MySQL Set DateTime In SQL ($iSQLStatement;1;$date;$cutTime)
>> $affectedRows:=MySQL Execute ($iSQLConnection;"";$iSQLStatement)
>> MySQL Delete SQL Statement ($iSQLStatement)

So I’ll re-test this using MySQL Select instead of mySQL Execute as you suggest 
and let you know what happens.

Once I have those results, I’ll try the manual way and use the different quotes 
and see how that goes. And also let you know.

Just so you know, I had faith that I was doing _something_ wrong, but couldn’t 
for the life of me figure out what it was. I couldn’t imagine that there was 
actually a flaw in myConnect itself.

I’ll give these suggestions a shot sometime in the next couple days.

Thanks,
Randy

----------------------------------------------------------------------
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com • (845) 359-0298 • PrintPoint, Inc • 57 Ludlow Lane • 
Palisades, NY 10964 


 

> On Nov 8, 2016, at 9:28 AM, Rob Laveaux <[email protected]> wrote:
> 
> 
> Hi Randy,
> 
> I just noticed your email on the NUG. Maybe next time you might want to send 
> me an email directly with your questions. 
> 
>> Has anyone using the myConnect plugin from Pluggers been able to 
>> successfully execute a SELECT or UPDATE statement doing a search on a 
>> DateTime field?
> 
> Yes, many times.
> 
>> I’ve tried doing a simple SELECT I build manually
>> $statement:="SELECT contactLogin FROM Contacts WHERE 
>> reset_password_token_created_at<='2016-11-02 17:09:46’;”
> 
> The problem is the quote at the end just before the semicolon. It is a curly 
> quote. Change it to a normal single quote and voila it works.
> 
>> I did that attempt after trying a more straightforward (I thought) sequence 
>> of:
>> $iSQLStatement:=MySQL New SQL Statement ($iSQLConnection;"SELECT 
>> contactLogin FROM Contacts WHERE reset_password_token_created_at<=?;")
>> MySQL Set DateTime In SQL ($iSQLStatement;1;$date;$cutTime)
>> $affectedRows:=MySQL Execute ($iSQLConnection;"";$iSQLStatement)
>> MySQL Delete SQL Statement ($iSQLStatement)
>> Also fails.
> 
> There is a difference between “fails" and “does not give the expected result”.
> The query is fine. That is not the problem. But for “SELECT” statements you 
> should use “MySQL Select” instead of “MySQL Execute”. Try that and you will 
> see it gives the expected result.
> 
>> That is how I originally started and was failing because I figured myConnect 
>> would be taking care of these formatting issues.
> 
> It does. You can obtain the SQL statement that gets executed by using "MySQL 
> Get SQL Statement”. 
> 
> HTH,
> 
> - Rob Laveaux
> 
> --------------------------------------------------------
> Pluggers Software
> Scholekstersingel 48
> 2496 MP  Den Haag
> The Netherlands
> 
> Email: [email protected] <mailto:[email protected]>
> Website: http://www.pluggers.nl <http://www.pluggers.nl/>
> 
> --------------------------------------------------------
> 
> 
> 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to