Hi I have the following data which i have scripted for your convenience:
if object_id('tempdb..#people') is not null drop table #people
create table #people
(
DOB datetime
)
insert into #people values('19630901')
insert into #people values('19640901')
insert into #people values('19650901')
insert into #people values('19660901')
insert into #people values('19670901')
insert into #people values('19681001')
insert into #people values('20000901')
I have to get age bands, Which is to the nearest 5
Age Agebands
48 45-50
47 45-50
46 45-50
44 40-45
43 40-45
11 10-15
The age is calculated as year(getdate()) - year(DOB)
How do I get the age bands?
regards
Mark
if object_id('tempdb..#people') is not null drop table #people
create table #people
(
DOB datetime
)
insert into #people values('19630901')
insert into #people values('19640901')
insert into #people values('19650901')
insert into #people values('19660901')
insert into #people values('19670901')
insert into #people values('19681001')
insert into #people values('20000901')
I have to get age bands, Which is to the nearest 5
Age Agebands
48 45-50
47 45-50
46 45-50
44 40-45
43 40-45
11 10-15
The age is calculated as year(getdate()) - year(DOB)
How do I get the age bands?
regards
Mark