Birthdays/Anniversaries

G

Guest

Is there any way to calculate the age of my clients and show the results in
the Calendar? For example: Thomas's 24 birthday
 
G

Guest

You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add two
new fields, "Age" and "Birthday". The Age field is a number, the birthday
field is a date. On the Age field, go to the Value tab on the Properties.
Under Initial Value, check "set initial value of this field to:" and add the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.
 
K

kj

Gentle with us amateur and non programmers, Josh!

I've managed the form design and even publishing to the organization forms
library, but I have two issues;

How can I apply this form to existing contacts?

The "age" calculated by the formula is the age at this years 'birthday", not
necessarily the current age.
i.e., if the contacts 30th birthday will be in October, the formula
currently displays age 30 today. Can the formula be changed to consider
months and days,not just years?

--
/kj
Josh said:
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add
two
new fields, "Age" and "Birthday". The Age field is a number, the birthday
field is a date. On the Age field, go to the Value tab on the Properties.
Under Initial Value, check "set initial value of this field to:" and add
the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.


wiersma7 said:
Is there any way to calculate the age of my clients and show the results
in
the Calendar? For example: Thomas's 24 birthday
 
J

Joshua Heard

Research the datediff function on MSDN. You will have to build a more
complicated expression for the field value to accomplish this. Datediff can
use year, month, day, or other interval to calculate the time intervals.
Then use another function to format the date. You might want to consider
writing a script instead. A script could automatically create the calendar
item which the original poster seemed to want.

To publish to existing contacts, there is a way, but I can't remember.
There is a word document that contains a script that someone made. It is
either on slipstick.com or MSDN. It gets complicated using form definitions
and such.


kj said:
Gentle with us amateur and non programmers, Josh!

I've managed the form design and even publishing to the organization forms
library, but I have two issues;

How can I apply this form to existing contacts?

The "age" calculated by the formula is the age at this years 'birthday",
not necessarily the current age.
i.e., if the contacts 30th birthday will be in October, the formula
currently displays age 30 today. Can the formula be changed to consider
months and days,not just years?

--
/kj
Josh said:
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add
two
new fields, "Age" and "Birthday". The Age field is a number, the
birthday
field is a date. On the Age field, go to the Value tab on the
Properties.
Under Initial Value, check "set initial value of this field to:" and add
the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.


wiersma7 said:
Is there any way to calculate the age of my clients and show the results
in
the Calendar? For example: Thomas's 24 birthday
 
K

kj

Not as simple as adding mm,dd to yyyy part of;
Datediff("yyyy",[Birthday],Now)
eh?

It figures. But you've spurred my interest, so I will go poke around MSDN
despite it all too frequently giving me a headache. ;-)

Thanks.

--
/kj
Joshua Heard said:
Research the datediff function on MSDN. You will have to build a more
complicated expression for the field value to accomplish this. Datediff
can use year, month, day, or other interval to calculate the time
intervals. Then use another function to format the date. You might want
to consider writing a script instead. A script could automatically create
the calendar item which the original poster seemed to want.

To publish to existing contacts, there is a way, but I can't remember.
There is a word document that contains a script that someone made. It is
either on slipstick.com or MSDN. It gets complicated using form
definitions and such.


kj said:
Gentle with us amateur and non programmers, Josh!

I've managed the form design and even publishing to the organization
forms library, but I have two issues;

How can I apply this form to existing contacts?

The "age" calculated by the formula is the age at this years 'birthday",
not necessarily the current age.
i.e., if the contacts 30th birthday will be in October, the formula
currently displays age 30 today. Can the formula be changed to consider
months and days,not just years?

--
/kj
Josh said:
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add
two
new fields, "Age" and "Birthday". The Age field is a number, the
birthday
field is a date. On the Age field, go to the Value tab on the
Properties.
Under Initial Value, check "set initial value of this field to:" and add
the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday
field,
his age appears in the age field. Publish the form, and you are all
set.


:

Is there any way to calculate the age of my clients and show the
results in
the Calendar? For example: Thomas's 24 birthday
 
S

Sue Mosher [MVP-Outlook]

DateDiff has rounding issues. See http://www.slipstick.com/contacts/calcage.htm for a formula that works in almost every case.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



kj said:
Not as simple as adding mm,dd to yyyy part of;
Datediff("yyyy",[Birthday],Now)
eh?

It figures. But you've spurred my interest, so I will go poke around MSDN
despite it all too frequently giving me a headache. ;-)

Thanks.

--
/kj
Joshua Heard said:
Research the datediff function on MSDN. You will have to build a more
complicated expression for the field value to accomplish this. Datediff
can use year, month, day, or other interval to calculate the time
intervals. Then use another function to format the date. You might want
to consider writing a script instead. A script could automatically create
the calendar item which the original poster seemed to want.

To publish to existing contacts, there is a way, but I can't remember.
There is a word document that contains a script that someone made. It is
either on slipstick.com or MSDN. It gets complicated using form
definitions and such.


kj said:
Gentle with us amateur and non programmers, Josh!

I've managed the form design and even publishing to the organization
forms library, but I have two issues;

How can I apply this form to existing contacts?

The "age" calculated by the formula is the age at this years 'birthday",
not necessarily the current age.
i.e., if the contacts 30th birthday will be in October, the formula
currently displays age 30 today. Can the formula be changed to consider
months and days,not just years?

--
/kj
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add
two
new fields, "Age" and "Birthday". The Age field is a number, the
birthday
field is a date. On the Age field, go to the Value tab on the
Properties.
Under Initial Value, check "set initial value of this field to:" and add
the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday
field,
his age appears in the age field. Publish the form, and you are all
set.


:

Is there any way to calculate the age of my clients and show the
results in
the Calendar? For example: Thomas's 24 birthday
 
K

kj

Thanks Sue. That formula works great except for the leap year babies as
noted.

Perhaps you can enlighten me on this. I was expecting this formula and forms
change to save the "age" value to the contact, but it seems to only
calculate the "age" when I create the contact or "run" the form. When I save
and exit the age value is not retained.

Did I do something wrong or are my expectations amiss?

--
/kj
DateDiff has rounding issues. See
http://www.slipstick.com/contacts/calcage.htm for a formula that works in
almost every case.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



kj said:
Not as simple as adding mm,dd to yyyy part of;
Datediff("yyyy",[Birthday],Now)
eh?

It figures. But you've spurred my interest, so I will go poke around MSDN
despite it all too frequently giving me a headache. ;-)

Thanks.

--
/kj
Joshua Heard said:
Research the datediff function on MSDN. You will have to build a more
complicated expression for the field value to accomplish this. Datediff
can use year, month, day, or other interval to calculate the time
intervals. Then use another function to format the date. You might want
to consider writing a script instead. A script could automatically
create
the calendar item which the original poster seemed to want.

To publish to existing contacts, there is a way, but I can't remember.
There is a word document that contains a script that someone made. It is
either on slipstick.com or MSDN. It gets complicated using form
definitions and such.


kj said:
Gentle with us amateur and non programmers, Josh!

I've managed the form design and even publishing to the organization
forms library, but I have two issues;

How can I apply this form to existing contacts?

The "age" calculated by the formula is the age at this years 'birthday",
not necessarily the current age.
i.e., if the contacts 30th birthday will be in October, the formula
currently displays age 30 today. Can the formula be changed to consider
months and days,not just years?

--
/kj
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age".
Add
two
new fields, "Age" and "Birthday". The Age field is a number, the
birthday
field is a date. On the Age field, go to the Value tab on the
Properties.
Under Initial Value, check "set initial value of this field to:" and
add
the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday
field,
his age appears in the age field. Publish the form, and you are all
set.


:

Is there any way to calculate the age of my clients and show the
results in
the Calendar? For example: Thomas's 24 birthday
 
S

Sue Mosher [MVP-Outlook]

You didn't say exactly how you implemented it. If you created a formula field, it should display a value both in the All Fields page and in the folder view.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
K

kj

I tried to follow the guidance from Josh's earlier post.

When I create a new contact and enter the bday, the age field is calculated
and displays the correct value. But when I save the contact and later reopen
it the "age" field while still 'defined' has no value. The Bday field
remains populated. So, it seems the age field is being calculated but not
saved. Does that make sense?

(The age field does show in the custom form and "all fields" but has no
value in either after saving)
/kj
=======
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add two
new fields, "Age" and "Birthday". The Age field is a number, the birthday
field is a date. On the Age field, go to the Value tab on the Properties.
Under Initial Value, check "set initial value of this field to:" and add the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.
======



--
/kj
You didn't say exactly how you implemented it. If you created a formula
field, it should display a value both in the All Fields page and in the
folder view.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

I don't have Josh's earlier post handy, so I don't know how you're implementing the age field.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



kj said:
I tried to follow the guidance from Josh's earlier post.

When I create a new contact and enter the bday, the age field is calculated
and displays the correct value. But when I save the contact and later reopen
it the "age" field while still 'defined' has no value. The Bday field
remains populated. So, it seems the age field is being calculated but not
saved. Does that make sense?

(The age field does show in the custom form and "all fields" but has no
value in either after saving)
/kj
=======
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add two
new fields, "Age" and "Birthday". The Age field is a number, the birthday
field is a date. On the Age field, go to the Value tab on the Properties.
Under Initial Value, check "set initial value of this field to:" and add the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.
======



--
/kj
You didn't say exactly how you implemented it. If you created a formula
field, it should display a value both in the All Fields page and in the
folder view.

kj said:
Thanks Sue. That formula works great except for the leap year babies as
noted.

Perhaps you can enlighten me on this. I was expecting this formula and
forms
change to save the "age" value to the contact, but it seems to only
calculate the "age" when I create the contact or "run" the form. When I
save
and exit the age value is not retained.

Did I do something wrong or are my expectations amiss?

--
/kj
DateDiff has rounding issues. See
http://www.slipstick.com/contacts/calcage.htm for a formula that works in
almost every case.
 
K

kj

Sorry, I included it below;
=======
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add
two
new fields, "Age" and "Birthday". The Age field is a number, the birthday
field is a date. On the Age field, go to the Value tab on the Properties.
Under Initial Value, check "set initial value of this field to:" and add
the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.
======

--
/kj
I don't have Josh's earlier post handy, so I don't know how you're
implementing the age field.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



kj said:
I tried to follow the guidance from Josh's earlier post.

When I create a new contact and enter the bday, the age field is
calculated
and displays the correct value. But when I save the contact and later
reopen
it the "age" field while still 'defined' has no value. The Bday field
remains populated. So, it seems the age field is being calculated but not
saved. Does that make sense?

(The age field does show in the custom form and "all fields" but has no
value in either after saving)
/kj
=======
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add
two
new fields, "Age" and "Birthday". The Age field is a number, the birthday
field is a date. On the Age field, go to the Value tab on the Properties.
Under Initial Value, check "set initial value of this field to:" and add
the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.
======



--
/kj
You didn't say exactly how you implemented it. If you created a formula
field, it should display a value both in the All Fields page and in the
folder view.

kj said:
Thanks Sue. That formula works great except for the leap year babies as
noted.

Perhaps you can enlighten me on this. I was expecting this formula and
forms
change to save the "age" value to the contact, but it seems to only
calculate the "age" when I create the contact or "run" the form. When I
save
and exit the age value is not retained.

Did I do something wrong or are my expectations amiss?

--
/kj
DateDiff has rounding issues. See
http://www.slipstick.com/contacts/calcage.htm for a formula that works in
almost every case.
 
S

Sue Mosher [MVP-Outlook]

So what exactly did you do? Did you publish the form and then create new contacts from the published form?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



kj said:
Sorry, I included it below;
=======
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add
two
new fields, "Age" and "Birthday". The Age field is a number, the birthday
field is a date. On the Age field, go to the Value tab on the Properties.
Under Initial Value, check "set initial value of this field to:" and add
the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.
======
kj said:
I tried to follow the guidance from Josh's earlier post.

When I create a new contact and enter the bday, the age field is
calculated
and displays the correct value. But when I save the contact and later
reopen
it the "age" field while still 'defined' has no value. The Bday field
remains populated. So, it seems the age field is being calculated but not
saved. Does that make sense?

(The age field does show in the custom form and "all fields" but has no
value in either after saving)
/kj
=======
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add
two
new fields, "Age" and "Birthday". The Age field is a number, the birthday
field is a date. On the Age field, go to the Value tab on the Properties.
Under Initial Value, check "set initial value of this field to:" and add
the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.
======



--
/kj
You didn't say exactly how you implemented it. If you created a formula
field, it should display a value both in the All Fields page and in the
folder view.

kj said:
Thanks Sue. That formula works great except for the leap year babies as
noted.

Perhaps you can enlighten me on this. I was expecting this formula and
forms
change to save the "age" value to the contact, but it seems to only
calculate the "age" when I create the contact or "run" the form. When I
save
and exit the age value is not retained.

Did I do something wrong or are my expectations amiss?

--
/kj
DateDiff has rounding issues. See
http://www.slipstick.com/contacts/calcage.htm for a formula that works in
almost every case.

:

Is there any way to calculate the age of my clients and show the
results in
the Calendar? For example: Thomas's 24 birthday
 
K

kj

Yes. Published the form and set the folder to use the new form when posting.

Open / close Outlook (just to be sure), create a new contact, enter the
birthday, and the Age field shows the correct value. Save and close the new
contact. Open the contact again. The birthday is there, but the age field is
blank.

I had to do something wrong in the process, but I don't know what. I'll go
over it some again, not quite so late at night.

--
/kj
So what exactly did you do? Did you publish the form and then create new
contacts from the published form?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



kj said:
Sorry, I included it below;
=======
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add
two
new fields, "Age" and "Birthday". The Age field is a number, the
birthday
field is a date. On the Age field, go to the Value tab on the
Properties.
Under Initial Value, check "set initial value of this field to:" and add
the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.
======
kj said:
I tried to follow the guidance from Josh's earlier post.

When I create a new contact and enter the bday, the age field is
calculated
and displays the correct value. But when I save the contact and later
reopen
it the "age" field while still 'defined' has no value. The Bday field
remains populated. So, it seems the age field is being calculated but not
saved. Does that make sense?

(The age field does show in the custom form and "all fields" but has no
value in either after saving)
/kj
=======
You can create a custom field which calculates a value using "datediff"
function.

First, enter design mode on the form. On tab p.2, rename to "Age". Add
two
new fields, "Age" and "Birthday". The Age field is a number, the
birthday
field is a date. On the Age field, go to the Value tab on the
Properties.
Under Initial Value, check "set initial value of this field to:" and add
the
following code:

Datediff("yyyy",[Birthday],Now)

Run the form. When you add the contact's birthday to the Birthday field,
his age appears in the age field. Publish the form, and you are all set.
======



--
/kj
You didn't say exactly how you implemented it. If you created a formula
field, it should display a value both in the All Fields page and in the
folder view.

kj said:
Thanks Sue. That formula works great except for the leap year babies as
noted.

Perhaps you can enlighten me on this. I was expecting this formula and
forms
change to save the "age" value to the contact, but it seems to only
calculate the "age" when I create the contact or "run" the form. When I
save
and exit the age value is not retained.

Did I do something wrong or are my expectations amiss?

--
/kj
DateDiff has rounding issues. See
http://www.slipstick.com/contacts/calcage.htm for a formula that works
in
almost every case.

:

Is there any way to calculate the age of my clients and show the
results in
the Calendar? For example: Thomas's 24 birthday
 
J

Joshua Heard

In design mode, look at the field calculation so that "calculate this field
automatically" is checked. "calculate this field when form is created" is
strangely the default.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top