Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
janderson206
Starting Member
4 Posts |
Posted - 2007-07-25 : 10:00:09
|
| Hello,if a customer DOB is 1933-06-30 and a date of service is on 2007-06-21that makes them 73 and not 74. How do I calculate an accurate years of age?Thanks in advance. |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-07-25 : 10:09:35
|
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=74462 KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-07-25 : 10:10:11
|
 KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
janderson206
Starting Member
4 Posts |
Posted - 2007-07-25 : 10:50:19
|
| Those are great examples but I have the dates stored in the database to calculate against. What is an example of using that function in a query? |
 |
|
|
janderson206
Starting Member
4 Posts |
Posted - 2007-07-25 : 10:54:13
|
| The goal is to calculate based on a recordselect dbo.F_AGE_IN_YEARS( a.ScheduledDTTM, a.DateOfBirth) as AGE, |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-07-25 : 11:17:47
|
quote: Originally posted by janderson206 Those are great examples but I have the dates stored in the database to calculate against. What is an example of using that function in a query?
The link I supplied has an example of using the function in a query.CODO ERGO SUM |
 |
|
|
janderson206
Starting Member
4 Posts |
Posted - 2007-07-25 : 11:51:54
|
| I was able to do what I wanted in SQL with the example you gave. Thanks.Now the sad part is I have to get that into crystal reports and from what I am reading you can't edit the sql code it generates. Pretty lame if thats true. |
 |
|
|
|
|
|