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
how can I make a script that can be bi-language (supports english, german)? : Sql dba
Can a composite key be null?
What is meaning of <> in sql?
What are different types of sql?
How is a process of pl/sql compiled?
What is cross join example?
explain the delete statements in sql
What is the current version of sql?
What program will open a mdb file?
what is the use of set statement in tsql? : Transact sql
What is the difference between function, procedure and package in pl/sql?
Does google use sql?
What kind of join is join?
explain the advantages and disadvantages of stored procedure? : Sql dba
Is coalesce faster than isnull?