Click here to Skip to main content
15,905,148 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi,

i want to display date(dob) from database to label
i want to display date in label
and also calculate age from date of birth
thanx
Posted
Comments
CHill60 1-Mar-14 15:23pm    
Ok ... you can go ahead and do that. Let us know if you hit a problem
Manish Dalwadi 1-Mar-14 15:24pm    
my dr. i have no idea for retrive date from database...so i asking you..
important id display date...for me.
JoCodes 2-Mar-14 0:30am    
Show some effort from your side then ask if you are stuck somewhere. "No idea for retrieve data from Db" doesnt help you either. A simple search would have made you learn this. And then the calculation part may be you could have asked.

1 solution

SELECT FLOOR((CAST (GetDate() AS INTEGER) - CAST(Date_of_birth AS INTEGER)) / 365.25) AS Age

Read this thread[^].

-KR
 
Share this answer
 
Comments
Manish Dalwadi 1-Mar-14 15:28pm    
sorry to say but i want sql code my dr.
please help me u can
coz i dont know how to do
Krunal Rohit 1-Mar-14 15:30pm    
This is a SQL Query and link also tells the same.

-KR
Manish Dalwadi 1-Mar-14 15:30pm    
okay

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900