title: sqlite join returning null even when both subqueries says otherwise
body: <p>I'm trying to run join on two tables in a sqlite database using subqueries(with/as). When I run the subqueries independently the value where ON clause is working exists in both tables yet when I apply a LEFT OUTER JOIN it gives null for those.
  <a href="https://i.stack.imgur.com/bGSuX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bGSuX.png" alt="enter image description here" /></a></p>
  <pre><code>    
  with transactionsData as (select (fee+amount) as chargedToCustomer,cast(substr(created,1,2) as decimal) as month,cast(substr(created,4,2) as decimal) as day from cardPayInvoices),
  invoicesData as (select &quot;Invoice Date&quot;,cast(substr(Amount,2) as decimal) as amountOnInvoice,
  CASe substr(customerExcels.&quot;Invoice Date&quot;,1,3)
      WHEN &quot;Jan&quot;
          Then 1
      WHEN &quot;Feb&quot;
          Then 2
      WHEN &quot;Mar&quot;
          Then 3
      WHEN &quot;Apr&quot;
          Then 4
      WHEN &quot;May&quot;
          Then 5
      WHEN &quot;Jun&quot;
          Then 6
      WHEN &quot;Jul&quot;
          Then 7
      WHEN &quot;Aug&quot;
          Then 8
      WHEN &quot;Sep&quot;
          Then 9
      WHEN &quot;Oct&quot;
          Then 10
      WHEN &quot;Nov&quot;
          Then 11
      WHEN &quot;Dec&quot;
          Then 12
  END monthFromDate           ,CAST( REPLACE(SUBSTR(customerExcels.&quot;Invoice Date&quot;,5,2),&quot;,&quot;,&quot;&quot;) as decimal) as dateOfMonthOnInvoice
   from customerExcels  where &quot;Customer Group&quot;=&quot;General&quot; or &quot;Customer Group&quot; like &quot;%OT LOGGED%&quot;)
  
  
  select      distinct t.*,a.* from transactionsData  AS t LEFT JOIN invoicesData as a ON t.month=a.monthFromDate AND t.day=a.dateOfMonthOnInvoice AND t.chargedToCustomer=a.amountOnInvoice
  </code></pre>
  <p>I have tried literally everything I could think of, I've checked for trailing blankspaces and what not and yet i cant find the solution</p>
  <p>table a(from subquery)
  <a href="https://i.stack.imgur.com/9gFK0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9gFK0.png" alt="enter image description here" /></a></p>
  <p>table t(from subquery)
  <a href="https://i.stack.imgur.com/mvbsX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mvbsX.png" alt="enter image description here" /></a></p>
  <p>Scheme</p>
  <pre><code>CREATE TABLE cardPayInvoices ( 
  [id] nvarchar(500) ,
  [created] nvarchar(500) ,
  [description] nvarchar(500) ,
  [currency] nvarchar(500) ,
  [fee] nvarchar(500) ,
  [amount] nvarchar(500) ,
  [origin] nvarchar(500) ,
  [originId] nvarchar(500) )
  
  
  
  CREATE TABLE customerExcels ( 
  [Invoice #] nvarchar(500) ,
  [Invoice Date] nvarchar(500) ,
  [Bill to Name] nvarchar(500) ,
  [Customer Group] nvarchar(500) ,
  [Amount] nvarchar(500) )
  
  
  dummy values: cardPayInvoices 
  insert into cardpayinvoices(id,created,description,currency,fee,amount,origin,originID) values(
  &quot;xxxx&quot;  &quot;07/01/2020 23:47:00&quot;   &quot;Capture (€294.30)&quot; &quot;EUR&quot;   &quot;20.86&quot; &quot;273.44&quot;    &quot;Transaction&quot;   &quot;xxxx&quot;)
  
  
  customerExcel
  insert into customerExcel(&quot;invoice #&quot;,&quot;invoice Date&quot;,&quot;Bill To Name&quot;,&quot;Customer Group&quot;,&quot;Amount&quot;) values(
  &quot;IT20-xxxx&quot; &quot;May 1, 2020 6:53:49 AM&quot;    &quot;ABC DEF&quot;       &quot;General&quot;   &quot;€103.79&quot;),
  (&quot;EN20-xxxx&quot; &quot;May 1, 2020 9:29:53 AM&quot;   &quot;GEH  IJK&quot;  &quot;General&quot;   &quot;€103.20&quot;),
  (EN20-xxxx May 1, 2020 1:41:18 PM   LMN OPQ     NOT LOGGED IN   €106.75)
  
  </code></pre>