Stuck on query logic

I have the server side mysql query all setup and working, but I just can’t get the logic for the condition.

I have a ‘project completion date’ and a ‘user late login date’. and I want to remind the user to login if they haven’t done so for longer than two days after the project has been complete.

Just getting me confused!

Where are you putting the logic ? SQL or SC ?

How do you plan on reminding the user to login? And where are you getting the dates from?

I am putting it in MySQL

How are you getting the User ID to retrieve your dates specific to the user if they aren’t logged in? Maybe a screenshot of your working query will help.

Hi @brad. I have already a MySQL query which outputs last login date and when the project was completed. which will run daily.
Where I am stuck is essentially how to say in the conditions of the mysql query,
“if user hasn’t logged in for 2 days after the project has been completed.”

Last Loggin Date value is LESS THAN NOW() and then use the formatter to calculated ADD Date -2.

1 Like

SELECT userid, DATEDIFF(end_date, last_login) as diffdays
Where diffdays <= -2

2 Likes

thanks @brad and @scalaris