I forgot to add ifNull() is NOT ANSI compliant but coalesce() is.

Dave

-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Dave Crozier
Sent: 09 February 2015 14:21
To: ProFox Email List
Subject: RE: [NF] Unreliable MySQL select

In MySQL you use:
        IFNULL(column, 0)

To force nulls to zero or any other value you require.

You can also use the coalesce () function to do a similar action.

Dave
-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Richard Kaye
Sent: 09 February 2015 14:09
To: [email protected]
Subject: RE: [NF] Unreliable MySQL select

Is it possible you have NULLs in pw_1? The most logical thing that comes to 
mind is the exceptions are not returning the expected data type. Does MySQL 
have the equivalent of the VFP NVL() function?

--

rk
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Virgil 
Bierschwale
Sent: Monday, February 09, 2015 8:58 AM
To: [email protected]
Subject: Re: [NF] Unreliable MySQL select

sends a true in the column called payday or a false depending on whether it is 
larger or smaller then the xml code parses the cursor and in the html code for 
google maps, it takes the true or false and turns on a red or blue.

All of that works, what doesn't work reliably (sometimes it does, and sometimes 
it doesnt) is this part in vfp type code

m.govamtpaid = 85320
m.amtpaid = pw_1

if m.amtpaid > m.govamtpaid
   flag = .T.
else
   flag = .F.
endif

supposedly that can all be done in the mysql select statement like I'm doing, 
and it appears to work, just not reliably which is puzzling to put it nicely.



On Sun, Feb 8, 2015 at 11:16 PM, AndyHC <[email protected]> wrote:

> Iif(CAST(pw_1...   ??
>
>
> On 09/02/2015 02:42, Virgil Bierschwale wrote:
>
>> $query = "SELECT *, if(CAST(pw_1 as DECIMAL)  > 85320, 'TRUE',
>> 'FALSE') as PAYDAY FROM lca2015 WHERE left(LCA_CASE_8,7) = 
>> '15-1121'";
>>
>>
>>
> <snip>
>


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to