Thu Apr 02, 2020 10:00 pm
Login Register Lost Password? Contact Us


Truth, False, or Blank

Questions around writing code and queries

Tue Feb 18, 2020 4:53 pm Change Time Zone

Hi everyone,

I was wondering how can I compare two files and check for matching records and flag each result accordingly with True, False, or Blank.

So for True or False I can easily use:
Code: Select all
self.fname_match := if(Le.fname = Ri.fname, 'T', 'F');


But how can I compare to get True, False or Blank when there is an empty string?
mo0926
 
Posts: 8
Joined: Thu Jan 09, 2020 3:57 pm

Tue Feb 18, 2020 5:02 pm Change Time Zone

mauricexxvi ,

You could do it this way:
Code: Select all
self.fname_match := MAP(Le.fname = '' AND Ri.fname = '' => '',
                        Le.fname = Ri.fname => 'T',
                        'F');

So this code reads: IF the names are blank, return blank, ELSE IF the names match return 'T' ELSE return 'F'.

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1522
Joined: Wed Oct 26, 2011 7:40 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron