Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 2nd, 2007, 10:45 PM
Registered User
Join Date: Jun 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting Respondents Age from Dates


I have spent some time trying to do the following, with limited success. Hopefully there is an easier way.

As part of a model I have created I run through a group of respondents for x amount of years

For each respondent I want to pick up their DOB from a datatable, and then using a StartDate, or current date work out the models age (rounded down)

i.e. DOB (from Table) = Dec 13th 1975
     Startdate = Now (July 3rd 2007)
     so age would be 31

My question is how what is the code for this, from Public or Dim to getting the answer of 31?

Any ideas?


Old July 3rd, 2007, 06:55 AM
Authorized User
Join Date: Nov 2006
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ef1196

A Google search on the subject returns many examples. Here is one:


Best Regards,
Earl Francis

Similar Threads
Thread Thread Starter Forum Replies Last Post
Age Calculation rgerald SQL Server 2000 32 October 10th, 2007 01:12 AM
age function keyvanjan ASP.NET 1.0 and 1.1 Basics 2 August 30th, 2006 08:46 AM
Vacancy Age alannoble26 Excel VBA 2 November 23rd, 2005 03:05 AM
Calculating and filtering age based on date shawnm Classic ASP Databases 4 November 12th, 2005 06:08 AM
calculating a persons age Hudson40 Access VBA 4 January 26th, 2005 11:45 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.