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
what is timestamp in mysql? : Sql dba
what is user defined functions? : Sql dba
What is delete command in sql?
Why do we create views in sql?
When is the update_statistics command used?
Why do we need cursors in pl sql?
Which tcp/ip port does sql server run on? How can it be changed? : Sql dba
What are the different ways to optimize a sql query?
How is a PL/SQL code compiled?
What is %type in sql?
what is a trigger in mysql? : Sql dba
Lookups are a key component in sql server integration services (ssis). Explain its purpose?
What is the use of non clustered index?
Is primary key is clustered index?
What is the command used to fetch the first 5 characters of a string?