var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Query Problems
Can someone help me with these problems?:
1) I have an update query set up to calculate a person's age, but if i enter a person's date of birth, the DB will not automatically update the age until i run the query, is there a way to have the age done automatically when a DOB is entered?
2)How do i group ages?
I want to create 8 groups
up to over 35
and so on, how do I do this?
assuming DOB is the date of birth stored in the database
select iif( FORMAT([enter date],'MMDD') < FORMAT(DOB,'MMDD')
, year([enter date])- year(DOB) -1
, year([enter date])- year(DOB)
) as age
or use Now() instead of [enter date] which i wrote for testing porpoises
create table agegroups
( agefrom smallint
, ageto smallint
, agegroup varchar(12)
insert into agegroups values (0,10,'Peewee')
insert into agegroups values (11,12,'Bantam')
insert into agegroups values (13,...
but where do I enter that in the database?
same place you run the query to calculate the person's age
If access 2000 create query in design view...
Then click view>sql
And paste the code
Assuming all the right field names exist, click view > design view to return to the query grid and all the tables / any existing relationships should appear...
ah, thanks, garethdart, i forgot this was access
in access you can create/run queries without ever seeing the sql
thanks for jumping in
sugetek, you can paste and run only one query at a time
first the CREATE TABLE, then an INSERT, then another INSERT, etc.