John,

Accessing a Paradox DB with the BDE uses Local SQL which is a subset of
SQL-92.

I can't see a way to do this - you may have to approach this another way,
like selecting each field individually, then navigating through the dataset
in code. Or maybe using TTable and adding a calculated field. Or change to a
better database :)

Also, you could restructure the table so that nulls weren't allowed in the
first place - default the fields to zero.

Steve

> -----Original Message-----
> From: John - Pacific Data Systems (NZ) [mailto:[EMAIL PROTECTED]
> Sent: Friday, 23 April 2004 7:40 a.m.
> To: NZ Borland Developers Group - Delphi List
> Subject: RE: [DUG] simple db query
> 
> 
> Hi Steve,
> 
> Thanks for your ideas. Unfortunately none of them seem to 
> work. I should
> have mentioned it right from the beginning I guess, the dbase 
> is Paradox.
> Any ideas how add fields in Paradox?
> 
> John
> 
> >-----Your Message-----
> >depending on your sql dialect you could try:
> >
> >SELECT IF(s1 IS NULL, 0, s1) + IF(...
> >SELECT IFNULL(s1, 0, s1) + IFNULL(...
> >SELECT COALESCE(s1, 0) + COALESCE(...
> >
> >Steve
> >
> >> -----Original Message-----
> >> I'd like to add multiple fields in a db query. That is not a
> >> problem, like:
> >>
> >> select s1+s2+s3 as TotalAmount
> >>
> >> However, when one of the field values is null, then the
> >> result is zero. How
> >> can I get this to work?
> >>
> >> TIA,
> >>
> >> John
> 
> _______________________________________________
> Delphi mailing list
> [EMAIL PROTECTED]
> http://ns3.123.co.nz/mailman/listinfo/delphi
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.655 / Virus Database: 420 - Release Date: 8/04/2004
>  
> 
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to