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 sql dialect?
What are the possible values for the boolean data field?
what are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee (eno int(2),ename varchar(10)) ? : Sql dba
How do you modify a column in sql?
How many functions are there in sql?
What is the difference between python and sql?
what are dynamic queries in t-sql? : Transact sql
Is stored procedure faster than query?
What is pl sql in oracle?
What are the basic sql commands?
What are the topics in pl sql?
What are records give examples?
How to create your own reports in sql developer?
What is scalar data type in pl sql?
What is rowtype?