I have a table with 3 columns. If I get lets say the age 35.4 I need to return AgeGroup 2.
I don't know for the life of me why i can't do it.
Please help.
Thanks
CREATE TABLE [dbo].[AgeGroup](
[AgeGroup] [tinyint] NOT NULL,
[FromAgeInYear] [tinyint] NULL,
[ToAgeInYear] [tinyint] NULL,
CONSTRAINT [PK_AgeGroup] PRIMARY KEY CLUSTERED
(
[AgeGroup] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT [dbo].[AgeGroup] ([AgeGroup], [FromAgeInYear], [ToAgeInYear] ) VALUES (1, 0, 35 )
INSERT [dbo].[GAgeGroup] ([AgeGroup], [FromAgeInYear], [ToAgeInYear] ) VALUES (2, 35, 55 )
INSERT [dbo].[AgeGroup] ([AgeGroup], [FromAgeInYear], [ToAgeInYear] ) VALUES (3, 55, 120 )