Re: Age Calculation

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Y2K (The Year 2000) was a potential major problem in the computer industry.
The problem was that many databases and other applications stored dates with
only 2 characters for the year. What that meant was that suddenly (as of
January 1, 2000) dates would be causing lots of problems when trying to
sort, compare etc.

You can use the formula (complex as it is) where you would normally use the
date of birth that you are storing as a text string.

The formula converts your date string into a DateTime type of variable.

Another method might be to use Michel Walsh's method.

The best thing you could do would be to change the field type to a DateTime
field and then find all the records with DOB greater than the current date
and fix them. This could be a bit of work, since you may have to fix other
parts of your database that relied on the field being a string field. In
the long run, you will probably be a lot better off storing the DOB in a
datetime field.


"Claudia R" <ClaudiaR@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9D7B7BEC-9EE3-4D0D-952C-9A86A0910804@xxxxxxxxxxxxxxxx
> Hi, thanks for your help.
> Y"K means nothing to me? Anything I should know?
> As to fix the problem, where do I place the expression you suggest?
> The field is in a text field with a date format mask to provide
> standarisation. and the field is part of a table.
> --
> Claudia R
>
>
> "Claudia R" wrote:
>
>> I succesfully run a query calculating members age from a birthdate field.
>> The
>> funny thing is that the query won't calculate properly people who was
>> born
>> before 1930.
>> E.g. if someone was born 1929 it gives me a -24 result, which in reality
>> should be 76 years of age. Any idea of what is going on?
>> Ah just for clarification the birthdate field is the following format:
>> 07-feb-29
>> Thanks in advance.
>> --
>> Claudia R


.



Relevant Pages

  • Re: Dates
    ... The conversion of a char data type to a datetime data type resulted in an ... out-of-range datetime value. ... System.Data.Common.DbDataAdapter.FillFromReader(Object data, String ... srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: DateTime WebService Discrepancy.
    ... When the datetime is sent by the webservice, ... > Ofcourse I had not even though of just passing a string as a parameter ... > locally and cut out the call to the web service. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Axis <-> .Net xsd:date interoperability problem
    ... .NET can de-serialize from alternative string representations of the date, ... but you need to tell it the format to expect. ... DateTime to be set. ... serialization of all DateTime's. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Zeitzonen und Benutzerdefinierte Formate --- Problem
    ... "Die Zeichenfolge wurde nicht als gültiges DateTime erkannt." ... Public Function ConvertDateTimeToCulture(ByVal sDateTime As String, ... Dim InputCulture = New ... Thread.CurrentThread.CurrentCulture = InputCulture ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • the safest way of handling datetime between asp.net and ms sql
    ... I know that a problem of different datetime strings formatting between ... asp.net and ms sql has been covered here widely, ... Let's say I'm keeping datetime variable in a session. ... cast it - how can I prevent it from casting it to string and inserting ...
    (microsoft.public.dotnet.framework.aspnet)