SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 changing date format and adding currency values
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

clarkson
Starting Member

2 Posts

Posted - 06/18/2013 :  10:40:40  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

Pakistan
1054 Posts

Posted - 06/18/2013 :  10:57:24  Show Profile  Reply with Quote
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 - 06/18/2013 :  11:53:28  Show Profile  Reply with Quote
I get the output to the browser using php+mysql.How to convert the date format?
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3704 Posts

Posted - 06/18/2013 :  12:04:05  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000