Click here to Skip to main content
15,120,477 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Server 2012 Agent Job & stored procedure issue URGENT Pin
NitinDhapte16-Jun-14 2:55
MemberNitinDhapte16-Jun-14 2:55 
GeneralRe: SQL Server 2012 Agent Job & stored procedure issue URGENT Pin
Seuss27-May-14 23:28
MemberSeuss27-May-14 23:28 
GeneralRe: SQL Server 2012 Agent Job & stored procedure issue URGENT Pin
Mycroft Holmes27-May-14 23:55
professionalMycroft Holmes27-May-14 23:55 
GeneralRe: SQL Server 2012 Agent Job & stored procedure issue URGENT Pin
Seuss28-May-14 0:00
MemberSeuss28-May-14 0:00 
GeneralRe: SQL Server 2012 Agent Job & stored procedure issue URGENT Pin
Seuss28-May-14 6:28
MemberSeuss28-May-14 6:28 
AnswerRe: SQL Server 2012 Agent Job & stored procedure issue URGENT Pin
Chris Quinn27-May-14 23:53
MemberChris Quinn27-May-14 23:53 
GeneralRe: SQL Server 2012 Agent Job & stored procedure issue URGENT Pin
Seuss28-May-14 0:01
MemberSeuss28-May-14 0:01 
QuestionHow to select the records who are completed exactly years comparing with joining date and todays date Pin
ven75326-May-14 7:09
Memberven75326-May-14 7:09 
Hi,

I have mysql database and employee details table is there with the column joining date.

i need to write a query in mysql in such a way that i should compare joining date with today date since i need to display employee details who are going to complete exactly 1 yr, 2 yr , 3yr ... and so on.

For ex:
Joining_Date Current_Date Years_Completed
2010-05-26 2014-05-26 4 years
2000-05-26 2014-05-26 14 years
2010-04-26 2014-05-26 4 years this row should not come since one month is less

only for todays date they should exactly complete years

How to achieve this. If anybody knows, please reply me.

Thanks in advance.
AnswerRe: How to select the records who are completed exactly years comparing with joining date and todays date Pin
jschell26-May-14 9:11
Memberjschell26-May-14 9:11 
GeneralRe: How to select the records who are completed exactly years comparing with joining date and todays date Pin
ven75326-May-14 22:27
Memberven75326-May-14 22:27 
AnswerRe: How to select the records who are completed exactly years comparing with joining date and todays date Pin
Mycroft Holmes26-May-14 13:52
professionalMycroft Holmes26-May-14 13:52 
GeneralRe: How to select the records who are completed exactly years comparing with joining date and todays date Pin
Sunasara Imdadhusen26-May-14 22:30
professionalSunasara Imdadhusen26-May-14 22:30 
AnswerRe: How to select the records who are completed exactly years comparing with joining date and todays date Pin
NitinDhapte16-Jun-14 3:18
MemberNitinDhapte16-Jun-14 3:18 
Questionaccess2010 pivot table Pin
hakata21-May-14 6:59
Memberhakata21-May-14 6:59 
QuestionAbnormal Behavior of SQL Server 2008 Enterprise Store Procedure Pin
jugnu_ad20-May-14 21:52
Memberjugnu_ad20-May-14 21:52 
AnswerRe: Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure Pin
Richard MacCutchan20-May-14 22:45
mveRichard MacCutchan20-May-14 22:45 
GeneralRe: Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure Pin
jugnu_ad20-May-14 22:47
Memberjugnu_ad20-May-14 22:47 
GeneralRe: Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure Pin
Richard MacCutchan20-May-14 23:26
mveRichard MacCutchan20-May-14 23:26 
AnswerRe: Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure Pin
Tim Carmichael21-May-14 2:35
MemberTim Carmichael21-May-14 2:35 
GeneralRe: Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure Pin
jugnu_ad21-May-14 2:45
Memberjugnu_ad21-May-14 2:45 
GeneralRe: Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure Pin
Simon_Whale21-May-14 2:50
professionalSimon_Whale21-May-14 2:50 
GeneralRe: Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure Pin
jugnu_ad21-May-14 2:56
Memberjugnu_ad21-May-14 2:56 
AnswerRe: Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure Pin
Eddy Vluggen21-May-14 8:52
professionalEddy Vluggen21-May-14 8:52 
GeneralRe: Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure Pin
Mycroft Holmes21-May-14 13:51
professionalMycroft Holmes21-May-14 13:51 
GeneralRe: Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure Pin
Tim Carmichael22-May-14 4:41
MemberTim Carmichael22-May-14 4:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.