| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 116949 | 2011-03-27 03:57:00 | Access Querry - selecting ages 18+ from DOB | Iain Palmer (11308) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 1189745 | 2011-03-27 03:57:00 | Hey all I'm greating a database using MS Access 2007, where I need to select everyone with an age of 18+ and display ages. I currenly are using the following to display ages in the querry and assated report Age: DateDiff( "yyyy", [DOB], Date() ) + ( Date() < DateSerial( Year( Date() ), Month([DOB]), Day([DOB]) ) ) How do I get the querry to display those aged 18 and over?? Thanks |
Iain Palmer (11308) | ||
| 1189746 | 2011-03-27 04:30:00 | Select <fields> from <tables> where DateDiff("yyyy", <DOB Field>, Date()) > 18; | inphinity (7274) | ||
| 1189747 | 2011-03-27 19:55:00 | Make that >=18 in the above post. So in your query view, look a few lines down and you'll find the criteri field. Put >=18 in the cell where you Age column intersects the Criteria line. |
Paul.Cov (425) | ||
| 1 | |||||