I want to display the employees who have joined in last two
months. (It should be executed randomly means If I execute
the query in March it should display Jan and Feb joined
employees. Same query if i execute in Feb, 2007 it should
display dec, 2006 and jan 2007 joined employees.
Answer Posted / balaji s.t
select convert(varchar(10),
dateadd(dd,-(day(dateadd(mm,1,getdate()))-1), dateadd(mm,-2,getdate())), 120),
convert(varchar(10),dateadd(dd,-(day(getdate())),getdate()),120)
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
is it possible to pass an object or table to a procedure as an argument?
What is foreign key in sql with example?
What is sql keyword?
Is sql a case sensitive language?
what are all the common sql function? : Sql dba
What is procedure in pl sql?
What are functions in sql?
What is the use of index in sql?
Can there be more than one function with a similar name in a pl/sql block?
Is ms sql traffic encrypted?
What is the difference between stored procedure and view?
How to return multiple rows from the stored procedure?
What is package in pl sql with an examples?
What will you get by the cursor attribute sql%rowcount?
Describe types of sql statements?