Re: [GENERAL] collecting employees who completed 5 and 10 years in the current month

2014-07-01 Thread Rebecca Clarke
From my understanding of what you're saying, you want all the employees that have a 5 year, or 10 year anniversary between today and the start of the current month? If that is the case, then this is what I came up with: select employee_name, to_char(current_date, '')::integer -

Re: [GENERAL] collecting employees who completed 5 and 10 years in the current month

2014-06-30 Thread Szymon Guz
On 30 June 2014 12:38, Arup Rakshit arupraks...@rocketmail.com wrote: I have employee table. Where I have a column joining_date. Now I am looking for a way to get all employee, who completed 5 years, 10 years current month. How to do so ? I am not able to figure this out. Regards, Arup

Re: [GENERAL] collecting employees who completed 5 and 10 years in the current month

2014-06-30 Thread Rebecca Clarke
Hi Arup, Two ways come to mind for me. They're pretty much the same as Szymon's, just minus the sample table creation. I would suggest creating a view instead, so you can just select from it whenever you please. create view vw_employee as select * from employees where

Re: [GENERAL] collecting employees who completed 5 and 10 years in the current month

2014-06-30 Thread Arup Rakshit
On Monday, June 30, 2014 04:52:32 PM you wrote: Hi Arup, Two ways come to mind for me. They're pretty much the same as Szymon's, just minus the sample table creation. I would suggest creating a view instead, so you can just select from it whenever you please. create view vw_employee as

Re: [GENERAL] collecting employees who completed 5 and 10 years in the current month

2014-06-30 Thread Szymon Guz
On 30 June 2014 17:52, Rebecca Clarke r.clark...@gmail.com wrote: Hi Arup, Two ways come to mind for me. They're pretty much the same as Szymon's, just minus the sample table creation. I would suggest creating a view instead, so you can just select from it whenever you please. create

Re: [GENERAL] collecting employees who completed 5 and 10 years in the current month

2014-06-30 Thread Arup Rakshit
On Monday, June 30, 2014 04:52:32 PM Rebecca Clarke wrote: Hi Arup, Two ways come to mind for me. They're pretty much the same as Szymon's, just minus the sample table creation. I would suggest creating a view instead, so you can just select from it whenever you please. create view