Creating Notifications

Discuss the database features

Creating Notifications

Postby qdaccounting » Fri Oct 05, 2018 5:25 pm

Hi,

I'm not sure if this question has arisen before. I would like to create a database that lists our Sub Contractors and enter their contact information as well as when their insurance and/or license expires. Once that is entered is there a way that every day when you open that particular database something pops up with a list of all the subs that have insurances that are expiring so that I can contact them and get the new info before the old info expires?

I hope I explained this correctly?
Thanks,
DV
Open Office 4 Windows 7
qdaccounting
 
Posts: 3
Joined: Thu Sep 13, 2018 11:12 pm

Re: Creating Notifications

Postby UnklDonald418 » Fri Oct 05, 2018 10:36 pm

is there a way that every day when you open that particular database something pops up with a list of all the subs that have insurances that are expiring so that I can contact them and get the new info before the old info expires?

Yes, SQL has a DATEDIFF function that could be used in a query to give that information. For instance if you had a database table with a DATE field named "ExpDate", then you could add a clause to a query, something like
Code: Select all   Expand viewCollapse view
DATEDIFF( 'day', CURDATE( ), "ExpDate" ) AS "Diff"

which would generate an integer value "Diff" for each record in your database table, "Diff" being the number of days from the current date until the expiration date.
Then if you added a WHERE clause to the query, something like
Code: Select all   Expand viewCollapse view
WHERE "Diff" <  30

you could limit the results to only the records where the expiration date is less than 30 days from the date the query is run.
To write a complete query requires knowledge of your database table structure.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.6 & LibreOffice 6.1.5.2 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 1176
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA


Return to Base

Who is online

Users browsing this forum: No registered users and 4 guests