Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Server Datetime Field - Select as dd/mm/yy ?

Author  Topic 

paramu
Posting Yak Master

151 Posts

Posted - 2010-04-10 : 05:30:52
The data from the table is like the below.

04-10-2010 : 12:00:00 ....

But I want to select as dd/MM/yy like
10/04/10
Is it possible?

My Query
Select Invoice_Date from Invoice_Master...........?

Thanks



Paramu @ PARANTHAMAN

Kristen
Test

22859 Posts

Posted - 2010-04-10 : 05:34:33
You should format data in your front end application, and not at the SQL Server end.

If that is not possible use

Select CONVERT(varchar(8), Invoice_Date, 103) from Invoice_Master
Go to Top of Page

paramu
Posting Yak Master

151 Posts

Posted - 2010-04-10 : 05:41:08
Thanks Kristen....

Paramu @ PARANTHAMAN
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-10 : 07:16:04
changing datatype for just formatting really makes date manipulations difficult. thats why we suggest to do this @ front end whenever you can

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -