Click here to Skip to main content
15,888,013 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,
12-12-2011 remove - from date need in such formate 12122011 in asp.net
Posted

please split and show required format.
and other format
get date form sqlserver

SQL
SELECT convert(varchar, getdate(), 112)
result come this type 
20120229


also see this link
http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/[^]
 
Share this answer
 
Comments
Tech Code Freak 29-Feb-12 3:53am    
5up!
Return date from Replace
<br />
DateString = DateString.Text.Replace("-", "")<br />


you can try this to replace multiple characters in single function
<br />
string val = System.Text.RegularExpressions.Regex.replace(val, @"[-_]", ""); <br />
 
Share this answer
 
Comments
Tech Code Freak 29-Feb-12 3:53am    
5up!
In C# you can use Replace() method,
C#
string dt="here goes your date expressin";
dt.Replace("-","");

in this way u can resolve ur problem using Replace() function.
hope this will help you..
 
Share this answer
 
Comments
Tech Code Freak 29-Feb-12 3:53am    
up!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900