Database Trick Part

By Petros
Aug 23, 2005
  1. I am building a database to keep info about clients. The trick part is that i want when a customers birthday occers, i want the system to print a report or a letter, automatically to the corresponding person that has his/hers birthday.
    How can this be done?
  2. MrGaribaldi

    MrGaribaldi TechSpot Ambassador Posts: 2,512

    First off, don't double post. We don't like it.

    What database system are you using?

    All you'd need would be a simple script running sending an SQL statement to the database, asking to retrive the dates birthdays..
    Something along the lines of
    SELECT name FROM users WHERE birthday = date;
    which will return a list of all the people in the database who's birthday is today...
    The script/php will have to supply the date in the same format that you've saved the birthdays...
  3. Petros

    Petros TS Rookie Topic Starter

    Database trick part.

    I am using Access. What about printing automaticaly a report? How can the query calculate the correct month and day without calculating the year?
    For example if someones birthdate is 12/11/1990 how will the query match the 12/11/2005 date if the year is different?
  4. Vigilante

    Vigilante TechSpot Paladin Posts: 1,666

    Maybe the first question should be, can access even MAKE this kind of "report"??

    Does access allow you to create essentially a "letter" where it will automatically fill in the blanks of peoples' names and so forth? If it CAN, them we'll chat about the rest.
    I've used Lotus Approach a few times, and I know it has a built-in function for creating envelopes where I can just click the button and boom, the current record's address is pasted on an envelope. So Access may have similar forms.

    Lastly, the query to find such records is not terribly difficult. As you should be able to check just day and month of a date without worrying about the year. The VBScript should have such functions. But we'll worry about it later.

    So then, NOT worrying about your query, can Access do the rest of what you need?
  5. Spike

    Spike TS Evangelist Posts: 2,168

    Aren't we simply talking about a mail merge with MS Word?? Not that I know how to do it with MS access these days - the last time I put a mail merge together was back in 1996. MS Works databases were far simpler back then as far as I can tell.
  6. RealBlackStuff

    RealBlackStuff TS Rookie Posts: 6,503

    You'd need to expand MrGaribaldi's code a little bit more and that is all, e.g.

    SELECT firstname, lastname, address1, address2, city, zip, country FROM customers WHERE (bday_mm = check_mm AND bday_dd = check_dd)

    For more syntax of SELECT see
Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...