Topic: message for birthday

Hi
Is there an script to show a Birthday Message in a specific date?
I recorded information for 100 employees of a company as well as their spouses and children.
is it possible that a message pops up on his/her  birthday, showing that person's name and when I click on his/her name, it refers me to that persons page.
thank you

Re: message for birthday

Hello, I saw a topic on the forum that did not get an answer.
This subject concerns birthday dates and may be interesting to apply it to other subjects, in particular to stocks or other archives.
Has an answer been posted?
-------------------------------------------------- ----------
Here is the message in question:
'message for birthday'

Hi
Is there a script to show a Birthday Message in a specific date?
I recorded information for 100 employees of a company as well as their spouses and children.
is it possible that a message pops up on his/her birthday, showing that person's name and when I click on his/her name, it refers me to that persons page.
thank you

Destiny

Re: message for birthday

Hello,

Here's an idea. Hope it can be a start to what you want to do with it.

Post's attachments

Attachment icon CheckBday.zip 549.47 kb, 224 downloads since 2022-11-27 

brian

Re: message for birthday

Thanks Brian, this example can be adapted for several programs.

Destiny

5 (edited by sparrow 2022-11-28 14:41:38)

Re: message for birthday

Hi all,


Slight modification of Brian's solution. By the way, I didn’t find solutions on the forum with launching with parameters, maybe I don’t see it well.
You can try, provided that there are not very many forms in the program. The more forms, the longer the launch.
If run at computer startup with the "bday.exe /min" parameters, it will display only information about the birthday, if not, then nothing. Message timeout 3 sec.
In normal startup mode, fully working.

Post's attachments

Attachment icon CheckBday mod1.zip 336.31 kb, 135 downloads since 2022-11-28 

Re: message for birthday

Hi Destiny, Brian, Sparrow,
Hope you're all well.
There are lots of ways to achieve this sort of thing - here's a very simplified option (based on Brian and Sparrow's examples) that doesn't require a script.
Regards,
Derek.

Post's attachments

Attachment icon CheckBday mod2.zip 336.79 kb, 184 downloads since 2022-11-28 

Re: message for birthday

Thanks to Brian, Sparrow and Derek for the examples they provided. That's great.
Thanks

Destiny

Re: message for birthday

Hi guys
thanks a lot for different approaches.
is it possible that an alert in shown a day or a week before someones birthday?
for example when you click on a bottom, an alert says that tomorrow is Tom's Birthday?
or a bottom show an alert that during the next month there will be 4 birthdays?
thanks

Re: message for birthday

There are lots of different ways you can do something like this - at it's simplest, you could just sort a 'next birthday due' column.
Attached is an option that colour codes the table grid depending on whether a birthday is due in the next 5 days (highlighted in red) or in the next 14 days (highlighted in yellow).
Derek.

Post's attachments

Attachment icon birthdaybash.zip 371.93 kb, 160 downloads since 2023-01-07 

Re: message for birthday

Hi everyone
Thank you all for your help
I created a project with many workers and their relatives.
and I have attached the sample project.
is it possible that when you click on the bottom "btShowBday" in the form "frmMain" all the workers and their relatives are shown on the form "frmBDayList" and an alert in shown for the birthday?
because in my sample When I click on that bottom only the worker is shown and his wife and children are not shown on the tablegrid.
please don not change the tables and forms

Post's attachments

Attachment icon CheckBday mod3.zip 336.97 kb, 139 downloads since 2023-01-08 

Re: message for birthday

Form frmBDayList - btSearch (SQL query)

SELECT name,                        
strftime('%m/%d/%Y',birthdate) as Birthdate,                                        
date('now') - birthdate + (case when strftime('%m-%d', 'now') < strftime('%m-%d', birthdate) then -1 else 0 end) as AGE 
FROM emp
WHERE strftime('%d-%m', birthdate) = strftime('%d-%m', 'now', 'localtime') 
UNION
SELECT fistname || '  ' || lastname,                        
strftime('%m/%d/%Y',birthdate) as Birthdate,                                        
date('now') - birthdate + (case when strftime('%m-%d', 'now') < strftime('%m-%d', birthdate) then -1 else 0 end) as AGE 
FROM wife
WHERE strftime('%d-%m', birthdate) = strftime('%d-%m', 'now', 'localtime') 
UNION
SELECT name || '  ' || lastn,                        
strftime('%m/%d/%Y',birthday) as Birthdate,                                        
date('now') - birthday + (case when strftime('%m-%d', 'now') < strftime('%m-%d', birthday) then -1 else 0 end) as AGE 
FROM children
WHERE strftime('%d-%m', birthday) = strftime('%d-%m', 'now', 'localtime') 
ORDER BY AGE DESC   

Re: message for birthday

Thank you sparrow for your help.
When I used this script in the sample project that I have attached, it works fine but when I insert it in my own project it shows the attached error message.
what am I doing wrong?

Post's attachments

Attachment icon Untitled.jpg 29.04 kb, 53 downloads since 2023-01-08 

Re: message for birthday

Check the ORDER BY line

Re: message for birthday

thanks a lot
I found the problem and solved it with your help.
It works great

Re: message for birthday

Hi Guys
Please help me with Edit Button
Why doesn't the Edit button in the form "frmBDayList" work?
it Shows an error: "No Record is Selected for editing"
How Can It be fixed ?

Post's attachments

Attachment icon CheckBday mod4.zip 337.04 kb, 82 downloads since 2023-04-09 

Re: message for birthday

Hi,
In your sqlquery code, you need to add the record id (see attached)
Derek.

Post's attachments

Attachment icon CheckBday mod4 fixed.zip 339.84 kb, 99 downloads since 2023-04-09 

17 (edited by sparrow 2023-04-09 14:33:14)

Re: message for birthday

Hi all,

You initially chose to store birthday data in three different tables, at least in this example.
These tables do not have any links with each other.
'Emp' works, while the wives and children go out on their own and in different places.


The final table in the form you point to displays data from THREE TABLES using a query
that combines the data for output using a UNION.
Unfortunately, in this case, it is problematic to display information about the ID and belonging
to the table.
Therefore, an error message is displayed that indicates that it is impossible to determine a unique identifier.
Solution:
Wrong - Sculpt various patches, where something is constantly wrong and not molded.
Correct - Recreate the database, taking into account the relationship between the employee and relatives)))) (Wives, children, etc.).
There should be strict relations in the family and not whoever wants where)))). And the program will get easier.


Derek's solution is just a temporary fix until the ID matches or is missing.

Re: message for birthday

Thank you Derek for your solution but as Sparrow mentioned it is only temporary and when I enter many records the results are not correct.
So in order to get the result for the entry's wife and children in a company, I entered a button "wife" in the last form "frmBDayList"
I put this button because I need the project to show whose wife is born on a specific day and when you push this button, the name of the wife and also the name of the personnel should be shown in one line on the tablegrid
In the attached project only the name of the wife is shown and not the name of the personnel.
thank you for your help

Post's attachments

Attachment icon CheckBday mod5.zip 336.61 kb, 98 downloads since 2023-04-10 

Re: message for birthday

Slightly corrected.

Post's attachments

Attachment icon CheckBday mod6.zip 328.17 kb, 110 downloads since 2023-04-10 

Re: message for birthday

Hi guys
I'd like to add another line of data to this project when it shows a person's birthday.
What I need to do is that  in the form "frmBDayList" the department of that person should also be shown.
like this:
First name   -  Last name   -    age   -  department

Post's attachments

Attachment icon CheckBday mod7.zip 337.21 kb, 82 downloads since 2023-06-06 

Re: message for birthday

Please help guys. It's very urgent to me.
Im stuck with this issue that I cant handle.
I have attached the project and I need to know whether it is possible using scripts or other aproaches.
Thanks alot

22 (edited by sparrow 2023-06-06 17:40:41)

Re: message for birthday

SELECT name, 
plastname,                                       
strftime('%Y', 'now', 'localtime') - strftime('%Y', birthdate) as AGE,
department.section,
emp.id as id
FROM emp Inner Join department ON emp.id_department=department.id
WHERE strftime('%d-%m', birthdate) = strftime('%d-%m', 'now', 'localtime') 
UNION
SELECT fistname, 
lastname,                                        
strftime('%Y', 'now', 'localtime') - strftime('%Y', birthdate) as AGE,
'Wife of '  || (SELECT name || '  ' || plastname FROM emp e WHERE e.id=wife.id_emp),
id_emp as id
FROM wife
WHERE strftime('%d-%m', birthdate) = strftime('%d-%m', 'now', 'localtime')

P.S.  add fix