Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3695648
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:38:35+00:00 2026-05-19T04:38:35+00:00

I have this big database table that contains 12 medical ceritifcations, expiration dates, links

  • 0

I have this big database table that contains 12 medical ceritifcations, expiration dates, links to files and what companies they’re from. I need to generate a report via email within 90,60,30 and 15 days of the the certification expiring date.

Here’s what the datebase looks like:

certID,
profileID,
cprAdultExp,
cprAdultcompany,
cprAdultImage,
cprAdultOnFile,
cprInfantChildExp,
cprInfantChildcompany,
cprInfantChildImage,
cprInfantChildOnFile,
cprFPRExp,
cprFPRcompany,
cprFPRImage,
cprFPROnFile,
aedExp,
aedcompany,
aedImage,
aedOnFile,
firstAidExp,
firstAidcompany,
firstAidImage,
firstAidOnFile,
emtExp,
emtcompany,
emtImage,
emtOnFile,
waterSafetyInstructionExp,
waterSafetyInstructioncompany,
waterSafetyInstructionImage,
waterSafetyInstructionOnFile,
bloodPathogensExp,
bloodPathogenscompany,
bloodPathogensImage,
bloodPathogensOnFile,
oxygenAdminExp,
oxygenAdmincompany,
oxygenAdminImage,
oxygenAdminOnFile,
lifegaurdingExp,
lifegaurdingcompany,
lifegaurdingImage,
lifegaurdingOnFile,
wildernessResponderExp,
wildernessResponderCompany,
wildernessResponderImage,
wildernessResponderOnFile, 
notes

How do I write some sort of loop to check all the dates (anything with EXP is a date) then store which ones are expiring, and email all those details to a person?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:38:36+00:00Added an answer on May 19, 2026 at 4:38 am

    Since you have to send the email through CF (I presume) then the way I’d approach this is to run a scheduled task once a day that checks which rows have a 15, 30, 60 and 90 day expiry anniversary. So the scheduled task would run a few queries and then send the emails.

    The first thing is to actually find the rows in question (all my SQL presumes MS SQL Server – other RDBMSs will have similar syntax):

    <cfquery name="qExpiring">
      select
      certID,  
      dateDiff(day, cprAdultExp, getDate()) as cprAdultExpDaysSince
      dateDiff(day, cprInfantChildExp, getDate()) as cprInfantChildExpDaysSince
      from yourTable
      where 
      dateDiff(day, cprAdultExp, getDate()) in (15, 30, 60, 90)
      or 
      dateDiff(day, cprInfantChildExp, getDate()) in (15, 30, 60, 90)
    </cfquery>
    

    This should give you a result set like so:

    certID|cprAdultExpDaysSince|cprInfantChildExpDaysSince|etc.
    ___________________________________________________________
    xxxxxx|30                  |5                         |etc.
    xxxxxx|16                  |60                        |etc.
    xxxxxx|2                   |90                        |etc.
    

    Any that have matches on 15, 30, 60, 90 you are interested in processing futher. You could use a query of queries to do this:

    <cfquery name="qAdultExpRenewal" dbtype="query">
      select * from qExpiring
      where cprAdultExpDaysSince in (15, 30, 60, 90)
    </cfquery>
    

    You cn then loop over these records and send the appropriate email based on the value of cprAdultExpDaysSince.

    You’re missing a fair bit of info to give you a comprehensive answer but I hope that this will point you in the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a var that contains a big list of words (millions) in this
I am having this big database on one MSSQL server that contains data indexed
I have a database table that contains Swedish/Norwegian strings. When I query some data,
I have a VB.net application with an Access Database with one table that contains
so I have this HTML table with a bunch of big numbers in it
I have a script that loads big images into the body in this fashion
I have a big table in my database with a lot of words from
I am working with a legacy database schema that looks like this: product_table table
I have a very large table in oracle that contains 140+ million rows. Currently
I have a big load of documents, text-files, that I want to search for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.