Date issues with INNER JOIN

Date issues with INNER JOIN

Experiencing a date issue when using INNER JOIN with zero results appearing. My table looks like the following and with a sub-query to find the latest "entry_date", then grouped by year and month and finally joined to the table to display the latest_date, type and amount. 

Original table
entry_date (Date)
amount (Currency)
type (String)
2020-01-31
$1000
Income
2020-02-04
$2500
Income
2020-02-29
$3200
Income
2020-03-10
$2600
Income
2020-03-31
$4400
Income
2020-04-10
$2100
Income

Expected output
latest_date (Date)
amount (Currency)
type (String)
2020-01-31
$1000
Income
2020-02-29
$3200
Income
2020-03-31
$4400
Income
2020-04-10
$2100
Income
...
...
...


Works fine in MySQL
  1. SELECT entry_date as latest_entry, amount, type
  2. from rents
  3. INNER JOIN (
  4. SELECT MAX(entry_date) AS maxdate
  5.     FROM rents
  6.     WHERE "type"  = 'Income'
  7.     GROUP BY YEAR(entry_date), MONTH(entry_date)
  8. ) x ON rents. entry_date = maxdate
However, I'm struggling to get this working with Analytics. I've tried various ideas with no luck.

Query runs with no results but the Main + Sub-query work fine individually. FYI: the sub-query looks for the latest date by year and month, this is by design, so LAST_DAY function will not work in my case. 
  1. SELECT
  2. DATE_FORMAT("t1"."entry_date", '%Y-%m-%d') as latest_date,
  3. "t1"."amount" as amount
  4. FROM  "rents" t1
  5. JOIN( SELECT date_format(max("t2"."entry_date"), '%Y-%m-%d') as maxdate
  6. FROM  "rents" t2 
  7. WHERE "t2"."type"  = 'Income'
  8. GROUP BY YEAR("t2"."entry_date"),
  9.   MONTH("t2"."entry_date") 
  10. ) x ON DATE_FORMAT("t1"."entry_date", '%Y-%m-%d')  = 'maxdate'  
I've done various other options in attempts to make this work and even changed the date format to sting from the original table and still no luck. I'm missing something with Analytics. 

Thanks in advance. 


      • Sticky Posts

      • Announcing Zoho Analytics 6.0 Beta!

        We are delighted to open up the next major version, Zoho Analytics 6.0 Beta! The new version comes packed with a wide range of functionalities for all persona, namely business users, data analysts, data engineers, and data scientists. Zoho Analytics team
      • What's New in Zoho Analytics - August 2024

        Hello Users! We are back with the latest updates and enhancements made to Zoho Analytics. Keep reading to learn more about them. Connect to the data hosted in the cloud without allow-listing the IP addresses Utilize Zoho Databridge to connect to the data
      • We are coming to your city! Zoho Analytics Community Meetup

        Hello, business leaders and data enthusiasts! We are delighted to announce that registrations are now open for the ZUG meetups, and we can't wait for you to be a part of them. Our in-house analytics experts are geared up to lead discussions on constructing
      • Zoho Analytics: 2021 Look Back

        As we start a new year in 2022, here's some of our top moments from 2021. Zoho Analytics in 2021
      • [Customer Talk] PREMO Group's Analyst Interview at Zoho Day 2022

        Premo Group, a 50 year old Spanish Manufacturing Company, has been our long-standing customer with #ZohoAnalytics. They've been using our platform for their end-to-end, unified business analytics solution.  Hear more from Claudio Cabeza, Director at PREMO