Hi, I've tried this but it gives me SQL errors. Adding incomeTracker in two places below. What am I doing wrong:
SELECT e.id,e.title,reminder_date,e.reminder_flag,u.memberID,u.email FROM expenseTracker, incomeTracker e
LEFT JOIN membership_userrecords m ON e.id=pkValue and m.tableName='expenseTracker', 'incomeTracker'
LEFT JOIN membership_users u on m.memberID=u.memberID
WHERE e.reminder_flag>='1' ORDER by e.id";
Reminder.
Re: Reminder.
Best Wishes,
Mark
Mark
Re: Reminder.
It would help us helping you if you could give more details on the tables and relations, perhaps an excerpt from your ERM.
I don't know your tables but for me the first JOIN looks weird.
The FROM clause naming two tables without joining them should result in a cartesian product which may not be what you want.
I don't know your tables but for me the first JOIN looks weird.
The FROM clause naming two tables without joining them should result in a cartesian product which may not be what you want.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Reminder.
Hi, the original code was from pböttcher and it worked without any tweaks. The full code uses a custom page, that looks through all members and if they have a matching date 'Reminder' set in the application then it emails the user giving some info about the reminder.
I just wanted the same but to include another table - so it looks at the 2 tables rather than one. I have it working by duplicating the code:
So the original code from pböttcher run an sql from the table 'expenseTracker'
SELECT e.id,e.title,reminder_date,e.reminder_flag,u.memberID,u.email FROM expenseTracker e
LEFT JOIN membership_userrecords m ON e.id=pkValue and m.tableName='expenseTracker',
LEFT JOIN membership_users u on m.memberID=u.memberID
WHERE e.reminder_flag>='1' ORDER by e.id";
Then duplicated to run another sql from another table 'incomeTracker'
SELECT e.id,e.title,reminder_date,e.reminder_flag,u.memberID,u.email FROM incomeTracker e
LEFT JOIN membership_userrecords m ON e.id=pkValue and m.tableName='incomeTracker'
LEFT JOIN membership_users u on m.memberID=u.memberID
WHERE e.reminder_flag>='1' ORDER by e.id";
I won't need more than 2 tables so probably not too bad this duplication, but if there is a way to concatenate it would be better.
Thanks.
I just wanted the same but to include another table - so it looks at the 2 tables rather than one. I have it working by duplicating the code:
So the original code from pböttcher run an sql from the table 'expenseTracker'
SELECT e.id,e.title,reminder_date,e.reminder_flag,u.memberID,u.email FROM expenseTracker e
LEFT JOIN membership_userrecords m ON e.id=pkValue and m.tableName='expenseTracker',
LEFT JOIN membership_users u on m.memberID=u.memberID
WHERE e.reminder_flag>='1' ORDER by e.id";
Then duplicated to run another sql from another table 'incomeTracker'
SELECT e.id,e.title,reminder_date,e.reminder_flag,u.memberID,u.email FROM incomeTracker e
LEFT JOIN membership_userrecords m ON e.id=pkValue and m.tableName='incomeTracker'
LEFT JOIN membership_users u on m.memberID=u.memberID
WHERE e.reminder_flag>='1' ORDER by e.id";
I won't need more than 2 tables so probably not too bad this duplication, but if there is a way to concatenate it would be better.
Thanks.
Best Wishes,
Mark
Mark