Age and Birthday

P

Phil Hunt

Hi,
Any quickie function to find out the birthday, given the age ?
btw, first time to cross post, hope i did it right

Thanks
 
J

Jeff Johnson [MVP: VB]

Any quickie function to find out the birthday, given the age ?
btw, first time to cross post, hope i did it right

??? If I told you my age you'd have a 1 in 365 chance of guessing my
birthday. Now granted, your chance of guessing my birth YEAR is 1 in 2....

I think you need to be more specific.
 
V

Veign

What do you mean range?..

Do you mean the range of years you could have been born in?
 
P

Phil Hunt

if you tell someone you are between 25 and 30, what are all the possible
birthday (mm/dd/yyy) you could be born on
 
L

Larry Serflaten

Phil Hunt said:
if you tell someone you are between 25 and 30, what are all the possible
birthday (mm/dd/yyy) you could be born on

What book is that from? Can anyone imagine a real life
need for such a function? ;-)

LFS
 
S

Saga

Could be used in filling out a survey where the approximate
age is requested, as is the approximate salary (ranges).

Saga
 
L

Larry Serflaten

Saga said:
Could be used in filling out a survey where the approximate
age is requested, as is the approximate salary (ranges).


What survey would want each and every date listed that
falls between two dates. More than likely the survey would
accept and *store* the two dates... :p

LFS
 
P

Phil Hunt

you are getting there.
Larry Serflaten said:
What survey would want each and every date listed that
falls between two dates. More than likely the survey would
accept and *store* the two dates... :p

LFS
 
M

MikeD

Phil Hunt said:
you are getting there.


Why are you being so elusive? If you want a definitive answer, then you need
to ask a definitive question. You're just beating around the bush.

Mike
 
M

MikeD

Phil Hunt said:
if you tell someone you are between 25 and 30, what are all the possible
birthday (mm/dd/yyy) you could be born on

Are 25 and 30 inclusive? If so, then there are 6 years involved. 365 (days
in a year) * 6 (number of years) = 2190 possible dates (of course, that
doesn't take leap years into account). I take it you don't want the number
though. You want the actual dates. That's more complicated. Are you going
to start with Jan 1st ~6 years ago? Are you going to start from whatever
date is exactly 6 years earlier than the current date? Are you going to go
until Dec 31 of the current year? Are you going to go only up to the
current date (IOW, disallow future birthdays for the current year)?

You need to elaborate on exactly what you need and possibly even the
purpose. I can't imagine any reason for needing to calculate EVERY date
within a given range. More curiosity than anything, but what on earth are
you planning to do with all of these dates once you've determined them?

Mike
 
D

Don

Are 25 and 30 inclusive? If so, then there are 6 years involved. 365 (days
in a year) * 6 (number of years) = 2190 possible dates (of course, that
doesn't take leap years into account). I take it you don't want the number
though. You want the actual dates. That's more complicated. Are you going
to start with Jan 1st ~6 years ago? Are you going to start from whatever
date is exactly 6 years earlier than the current date? Are you going to go
until Dec 31 of the current year? Are you going to go only up to the
current date (IOW, disallow future birthdays for the current year)?

You need to elaborate on exactly what you need and possibly even the
purpose. I can't imagine any reason for needing to calculate EVERY date
within a given range. More curiosity than anything, but what on earth are
you planning to do with all of these dates once you've determined them?

Mike

Give the User a list of all possible b'dates so he/she can pick the real one...
<BeG>

Have a good day...

Don
 
P

Phil Hunt

I am not trying to be elusive. You only get that feeling from jumping into
middle of the conversation. My situation is this: i have a lot of people on
the DB with their birthday, and I want to find them by asking "where Age is
between 25 and 35"
Anyway, i was just being lazy to ask. I later found out I can use
DateAdd("YYYY",-25,Date) and DateAdd("YYYY",+35,Date). Now can you concur
with with ?
 
R

Rick Rothstein

if you tell someone you are between 25 and 30, what are all the
possible
Give the User a list of all possible b'dates so he/she can pick the real one...
<BeG>

Yep, I can see a paraphrase of that program now...

Program: "How old are you?"
User: "Somewhere between 25 and 30 years old"
Program: "Okay, here's a list of 2190 possible days
for your birthday, please select one"
User: "Hmm! Let's see now...."

Rick
 
B

Bob Butler

Phil Hunt said:
I am not trying to be elusive.

Maybe not, but that's the result.
You only get that feeling from jumping
into middle of the conversation.

I saw what looked like an initial post and read from there on and still
think the question has been unecessarily vague.
My situation is this: i have a lot
of people on the DB with their birthday, and I want to find them by
asking "where Age is between 25 and 35"
Anyway, i was just being lazy to ask. I later found out I can use
DateAdd("YYYY",-25,Date) and DateAdd("YYYY",+35,Date).

You need to get anybody who turns 25 today through anybody who turns 36
tomorrow; DateAdd will do it but what you have there is not correct.
Now can you concur with with ?

Huh?
 
J

Jeff Johnson [MVP: VB]

I am not trying to be elusive. You only get that feeling from jumping into
middle of the conversation. My situation is this: i have a lot of people on
the DB with their birthday, and I want to find them by asking "where Age is
between 25 and 35"

And HOW IN THE WORLD were we supposed to figure that out from your initial
question, which I'll repeat here:

Next time you work on a project and you're gathering requirements from your
users and you have to virtually pull teeth to get information out of them,
maybe you'll understand what it's like for us and try to be more clear the
next time you post a question in a newsgroup.
 
P

Phil Hunt

I thought that what programmer do, make sense out of some vague questions
that the user asked.
 
J

Jeff Johnson [MVP: VB]

I thought that what programmer do, make sense out of some vague questions
that the user asked.

We very often do. And, having felt the pain, we try not to do it TO EACH
OTHER.
 

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