Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
aarohipatel
Creator II
Creator II

SQL Query help

Hi ,

I am trying to write the following Oracle database query in SQL Server database

to_date(to_char(GETDATE(), 'DD-MON-YYYY'), 'DD-MON-YYYY')

Please suggest.

Thank you

1 Solution

Accepted Solutions
aarohipatel
Creator II
Creator II
Author

I am using this and it works for me:

format(created_date,'dd-MMM-yyyy')

View solution in original post

5 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

See the below:

Capture.PNG

Thanks

aarohipatel
Creator II
Creator II
Author

Hi Sinan,

The end result should be in the format 'DD-MON-YYYY'

Note: The datatype of getdate is : Datetime2

vishsaggi
Champion III
Champion III

use 106. From sinan expression use like

Convert(nchar, Getdate(), 106)

aarohipatel
Creator II
Creator II
Author

I am using this and it works for me:

format(created_date,'dd-MMM-yyyy')

vishsaggi
Champion III
Champion III

Glad you figured it out.Close the thread accordingly.