Update Querry

G

Guest

Hiii dear friends i have a problem with update Querry i have a table that has
many fields but Date_Of_Birth and Bonus are two fields of them. so in
Date_Of_Birth i have obviously different dates of birth of the people and i
want to give bonus 200 to all those people whose age is less then or equal to
25 years. Example
Date_Of_Birth Bonus
1-Jan-1978
23-Apr-1988
4-Mar-1973
12-Sep-1980

date is writen in the above pattern so plz help me . i will be thankful.
 
J

John Spencer (MVP)

First of all, have you considered what to do when the person reaches 26. Does
the bonus stay?

Second, you didn't specify the age as of any specific date.

SELECT Date_Of_Birth,
Bonus: IIF(Date_Of_Birth > DateAdd("yyyy",-25, Date()),200,Null)
FROM YourTable
 

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