PDA

View Full Version : Pre sales query


stourswim
07-16-2010, 09:55 AM
Hi all
I have looked at the sample databases and got them to work on my web site so now want to start designing my own application. However before purchasing
I have a question and that is I need to be able to filter a contact list by Date of Birth. Ideally between two dates to view and print the membership by age groups. However non of the filters shown can do this. I am no expert but how can this be done easily. I want the user to be able to change these filter dates online.

Hope someone can help as I dont want to buy until sure I have cracked this problem

twenty1
07-16-2010, 02:33 PM
Hi -

Not sure you can get there using a filtered view of the data. You will probably need a simple php script to run and sql query.(eg)You can also use the BETWEEN function with dates.

SELECT *
FROM orders
WHERE order_date between to_date ('2003/01/01', 'yyyy/mm/dd')
AND to_date ('2003/12/31', 'yyyy/mm/dd');

This SQL statement would return all orders where the order_date is between Jan 1, 2003 and Dec 31, 2003 (inclusive).

It would be equivalent to the following SQL statement:

SELECT *
FROM orders
WHERE order_date >= to_date('2003/01/01', 'yyyy/mm/dd')
AND order_date <= to_date('2003/12/31','yyyy/mm/dd');

Cheers :D