Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello! I have a table that I add

Status
Not open for further replies.

armstrong722

Technical User
Feb 26, 2002
32
0
0
US
Hello!

I have a table that I added a field to and I would like to fill it with ages. There is a birthday field in the same table. So what I was wondering was whether I could make a query and pull the new field in [players_age] and using expression builder and a function for age populate the field with the players age.
My syntax is the following

Field: Players_Age
Criteria =Age(birthday,todaysdate)

I have the function allready built and it works.
but I can't seem to find the correct syntax.

Is this possible?

thanks from
a very new access user
armstrong
 
You can certainly create a query and update the table. However, you are breaking relational rules by storing data that is dependent on another column. What happens when the player's age changes. Are you going to continually update the table?

Example query: uses the function Age

Update MyTable
Set Players_Age=Age(Birthday,date())
Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions in the SQL Server forum. Many of the ideas apply to all forums.
 
Thank you Terry
I'll read the faq first and then on to my problem
armstrong
 
Ok thanks,

I have been using this product for about 3 weeks. This is a database for 500 little league kids. I've got alot accomplished but believe me nothing has come easy. Many nights up late...

I need to figure out their playing age for this year and check that against the league they registered for. I'm sure there are a hundreds ways to do this but I really don't know where to begin except a way that I think gets this accomplished. I have trouble finding the basics because most assume including the help files that you must know them.

Putting these into a table is not correct, maybe it should just go into a query? Is this possible.. to build a query and fill it with some table data and some calculated data. forgive me for the mundane and what looks like lazy questions. I can assure you I'm trying hard.

armstrong
 
You can compute the age in a select query. That is preferred to storing the age in the table.

Select
Name, Birthdate,
Age(Birthday,date()) As Player_Age,
League, ...
From TheTable
Where ... Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions in the SQL Server forum. Many of the ideas apply to all forums.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top