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
 changing date format and adding currency values

Author  Topic 

clarkson
Starting Member

2 Posts

Posted - 2013-06-18 : 10:40:40
This is my table.
CREATE TABLE Sales(
store_name VARCHAR(50),
Sales DECIMAL(10,2),
Date DATE);
But I can insert into the table Date fields in the format of YYYY-MM-DD
only.But I want to get the output to the browser in the form of for example Jan-05-1999.And also how to get the sales value without decimal parts?

MIK_2008
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2013-06-18 : 10:57:24
you can handle formatting in the application as you want. Is there any specific need to get this done through the SQL server?

I would suggest to handle such formatting things on the application end (for sake of better performance) instead of doing it in SQL server

Cheers
MIK
Go to Top of Page

clarkson
Starting Member

2 Posts

Posted - 2013-06-18 : 11:53:28
I get the output to the browser using php+mysql.How to convert the date format?
Go to Top of Page

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-06-18 : 12:04:05
I don't know how to format the dates in MySQL. This forum is for Microsoft SQL Server, so I would be surprised if there are many here who know MySQL. But, just a quick googling brought me to this page, which has the various format strings and examples: http://www.w3schools.com/sql/func_date_format.asp
Go to Top of Page
   

- Advertisement -