From: SeeAll on
Hi,

I am using a census database to enter data from the 1901 UK census. To calculate the year born the input age is subtracted from 1901. However, when a child under one year old is enter, obviously an error shows.

What do I need to do to show 1901 when a child's age under one year is entered. The age field can hold three numbers and one letter (h = hours, d=days, w=weeks, m=months) if needed, eg., 5, 100, 5w.

Regards

Jeff
From: Jeff Boyce on
Jeff

You mentioned subtracting the input age from 1901, but then you mention the age field holding only hours, days, weeks or months.

How are you doing that subtraction if the person is over 1 year old?

And it sounds like you are trying to calculate the year born ... if the person is under one year old, weren't they born in 1900? Could you just check the "age field" to see if there's a letter, then decide they were less than one?

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"SeeAll" <seeallscansuk(a)yahoo.co.uk> wrote in message news:O72dnfkpzs2zKpvRnZ2dnUVZ8uGdnZ2d(a)bt.com...
Hi,

I am using a census database to enter data from the 1901 UK census. To calculate the year born the input age is subtracted from 1901. However, when a child under one year old is enter, obviously an error shows.

What do I need to do to show 1901 when a child's age under one year is entered. The age field can hold three numbers and one letter (h = hours, d=days, w=weeks, m=months) if needed, eg., 5, 100, 5w.

Regards

Jeff
From: SeeAll on
Hi Jeff,

the age field can hold 4 characters, 3 numerals (1-100) and either h,d,w, or m., dependent on the input age. I input the age into the age field, e.g., age 45 this is subtracted from 1901 = 1856 (which is entered into the year born field). If a child is, let's say 8 months, then I enter [space][space]8m. When 8m is subtracted from 1901, I would like it show 1901 in the year born field.

Regards

Jeff
From: Jeff Boyce on
So if you use a query to inspect that field, and it sees any characters, that makes it a less-than-one year old, right?

I guess it would depend on whether the 1901 is 1/1/1901 or 12/31/1901...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.


"SeeAll" <seeallscansuk(a)yahoo.co.uk> wrote in message news:TY6dnUuPWNH5T5vRnZ2dnUVZ8tmdnZ2d(a)bt.com...
Hi Jeff,

the age field can hold 4 characters, 3 numerals (1-100) and either h,d,w, or m., dependent on the input age. I input the age into the age field, e.g., age 45 this is subtracted from 1901 = 1856 (which is entered into the year born field). If a child is, let's say 8 months, then I enter [space][space]8m. When 8m is subtracted from 1901, I would like it show 1901 in the year born field.

Regards

Jeff
From: SeeAll on
Hi Jeff,

thanks for your input. Query written and working.

Regards

Jeff