GeekInterview.com
Series: Subject: Topic:
Question: 14 of 213

How to get number of days using SQL ?

I have table .. like EMPNO Ename DOB ------------------------------------ 1 you 1-jan-2011 2 Me 28-jan-2011 tel me the query for no.of days different from.. two dates of column DOB.? Thanks in advance. Sateesh
Asked by: sateesh44 | Member Since Oct-2010 | Asked on: Nov 24th, 2011

View all questions by sateesh44   View all answers by sateesh44

Showing Answers 1 - 1 of 1 Answers
kirathakudu

Answered On : Dec 13th, 2011

View all answers by kirathakudu

select date1-date2 from tablename;

If the above value is negative it means date 1 is older than date 2

Yes  2 Users have rated as useful.
  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.