Read on full site | Join TechSpot! (it's free) | Bookmark / Share this



Database Trick Part

Petros
08-23-2005, 02:12 AM
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?

MrGaribaldi
08-23-2005, 10:10 AM
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...

Ad
08-23-2005, 10:10 AM
  

Petros
08-24-2005, 02:04 AM
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?

Vigilante
08-24-2005, 02:41 AM
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?

Spike
08-24-2005, 02:53 AM
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.

RealBlackStuff
08-24-2005, 03:20 AM
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 http://www.firstsql.com/tutor2.htm

Post a reply, see related topics & more

Tip: Download Advanced SystemCare 3 Free - Clean, Repair, Protect & Optimize your PC.



 Top Technology News

Weekend Open Forum: Google Chrome OS and the future of cloud computing

Tech Tip of the Week: Unearth Region-Specific Windows 7 Themes

Sony: PlayStation 3 to be 3D-capable via firmware update

iSuppli: DDR3 to account for over half of DRAM shipments by Q2 2010

Facebook named third most popular video website behind YouTube and Hulu

Patriot introduces new PS-100 SSD series

Sony working on digital store for music, movies, books

Details of Intel's 32nm Atom emerge, on track for 2011

More Tech News

  
 Software Downloads

Norton Virus Definitions 2003-07 November 20, 2009

AVG Anti-Virus Updates November 20, 2009

Norton Virus Definitions 2008-09 November 20, 2009

avast! Virus Definitions November 20, 2009

McAfee SuperDAT Update 5808

Kaspersky Anti-Virus Update November 20, 2009

Google SketchUp 7.1.6087

More Downloads



Copyright © 1998-2009 TechSpot.com. TechSpot is a registered trademark. All Rights Reserved.