system date format is "yy-mm-dd"
"select getdate()" ----> 2009-01-24 20:03:28.513
if i write "select dateadd(dd,2,getdate())
".it returns "2009-01-26 19:59:38.340"...my question is dat
could it be possible to retrive da date in da format "26
jan 2009 ...."??

Answers were Sorted based on User's Feedback



system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:2..

Answer / praveen kumar.dandu

select to_char('sysdate',dd mon yyyy)from dual



convert the date format to chars and retrive the the system
date in the format what eve r u like

Is This Answer Correct ?    9 Yes 2 No

system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:2..

Answer / deepa

select getdate()
select Dateadd(dd,2,getdate())
select convert(varchar(12),Dateadd(dd,2,getdate()),106)

Is This Answer Correct ?    6 Yes 0 No

system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:2..

Answer / moid

select convert(varchar(20),getdate(),100)

Is This Answer Correct ?    4 Yes 1 No

system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:2..

Answer / shailesh s. deshmukh

select convert(varchar(20),getdate(),106)

Is This Answer Correct ?    4 Yes 1 No

system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:2..

Answer / senthil kumar.m

select convert(varchar,getdate(),106)

Is This Answer Correct ?    3 Yes 1 No

system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:2..

Answer / bipin singh

Try this this will works fine.

select convert(varchar,dateadd(day,2,getdate()),106)

Is This Answer Correct ?    2 Yes 1 No

system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:2..

Answer / swapan

select convert(varchar(20),getdate()+int,100)

Is This Answer Correct ?    0 Yes 1 No

system date format is "yy-mm-dd" "select getdate()" ----> 2009-01-24 20:03:2..

Answer / shailesh s. deshmukh

Dear friend try this one

select convert(varchar(11), getdate(),106)+(SELECT right
(GETDATE(),8))
as Date

or

select convert(varchar(11), getdate(),106)+(SELECT STUFF
(getdate(), 1, 11, ''))
as Date

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SQL Server Interview Questions

What are views used for?

1 Answers  


How to rebuild indexes with alter index ... Rebuild?

1 Answers  


I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that

1 Answers  


How to display n-1 columns from n number of columns, from a single table in MS SQL server 2005?

2 Answers  


Why truncate is ddl command?

1 Answers  


What is the system function to get the current user's user id?

2 Answers   HCL,


What is the use of builtinadministrators group in sql server? : sql server security

1 Answers  


What is the osql utility?

1 Answers  


What is indexed view?

1 Answers  


I create a separate index on each column of a table. What are the advantages and disadvantages of this approach? : Sql server database administration

1 Answers  


difference between Clustered index and non clustered index ?

1 Answers   Infosys,


How to check what was the last restore transaction LSN on Log-Shipping and Mirroring when we doesn't have a Monitor server and Witness server?

2 Answers   IBM,


Categories