[mso] Re: Access 2000 date routines ? Pre-written somewhere? :VSMail mx1

  • From: "James LaBorde" <jlaborde@xxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Mon, 19 Jun 2006 08:46:48 -0700

Robert,

I don't recall seeing it, but it should be possible with code.  If you =
want to give it a shot I would be happy to help (and I won't even charge =
you $25/yr for the code).

Plug this into a module, compile and save it:

**********Snip Here*****************
Function GeneologyAge(DtBegin As Date, DtEnd As Date) As String

Dim strYears As String
Dim IntYears As Integer
Dim strMonths As String
Dim IntMonths As Integer
Dim strDays As String
Dim IntDays As Integer

IntYears =3D DateDiff("yyyy", DtBegin, DtEnd)
strYears =3D CStr(IntYears)

Do
If Len(strYears) < 3 Then
strYears =3D "0" + strYears
End If
Loop Until Len(strYears) =3D 3

DtBegin =3D DateAdd("yyyy", IntYears, DtBegin)

IntMonths =3D DateDiff("m", DtBegin, DtEnd)
strMonths =3D CStr(IntMonths)

If Len(strMonths) < 2 Then
strMonths =3D "0" + strMonths
End If

DtBegin =3D DateAdd("m", IntMonths, DtBegin)

IntDays =3D DateDiff("d", DtBegin, DtEnd)
strDays =3D CStr(IntDays)

If Len(strDays) < 2 Then
strDays =3D "0" + strDays
End If

GeneologyAge =3D strYears + strMonths + strDays

End Function
************Snip Here********************

After you do that all you have to do is Call the GeneologyAge function =
in your query and plug in your begining and ending dates.  This should =
return the data in the format you are looking for.

If you need any more assistance with it please feel free to ask.

Thank You,
James La Borde






-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx]On
Behalf Of Robert Carneal
Sent: Friday, June 16, 2006 4:50 PM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Access 2000 date routines ? Pre-written somewhere?
:VSMail mx1


It seems as though I saw a site with some "genealogy-related date =
routines
for Access 2000" somewhere. Where you were allowed to view the code (in =
some
cases, copy it if you wanted); and I think there was a small fee =
involved.
($25.00/yr ??) If anyone knows what I am talking about, please let me =
know.
I searched through my Archives and MSO Archives to no avail.

What I very much would like to do in Access is have two dates (one or =
both
may be before 1900-01-01) and properly calculate the date to give a
seven-digit representation of age.
Example:
Date 1: 1855-01-15
Date 2: 1935-04-09

Age in years, months, days is 80yrs, 2mths, 25 days. Or, in YYYMMDD =
format,
0800225. A YYYMMDD format allows for a max age of 9991230, 999yrs, 12 =
mths,
& 30 days. Does anyone recall this please?

Thank you.

Robert

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx =
or MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the =
dropdown menu at the top.  This will allow you to unsubscribe your email =
address or change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, =
send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an =
invitation with instructions.  Once you are a member of the files group, =
you can go here to upload/download files:
http://www.smartgroups.com/vault/msofiles

If you are using Outlook and you see a lot of unnecessary code in your =
email messages, read these instructions that explain why and how to fix =
it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the dropdown 
menu at the top.  This will allow you to unsubscribe your email address or 
change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles

If you are using Outlook and you see a lot of unnecessary code in your email 
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************

Other related posts: