Lets Have a fun with Technology.

BTemplates.com

Follow by Email

Thursday, September 25, 2008

DateTime Format in SQL Server And MS Access


SQL SERVER 2000 
 
Convert DateTime Format in Sql Server Query.

   convert(varchar,emp.val_date,106) AS ind_date1    

106 is Format type Format Type List Give Below.



 
Style ID  Style Type    
0 or 100  mon dd yyyy hh:miAM (or PM)    
101  mm/dd/yy    
102  yy.mm.dd    
103  dd/mm/yy    
104  dd.mm.yy    
105  dd-mm-yy    
106  dd mon yy    
107  Mon dd, yy    
108  hh:mm:ss    
9 or 109  mon dd yyyy hh:mi:ss:mmmAM (or PM)    
110  mm-dd-yy    
111  yy/mm/dd    
112  yymmdd    
13 or 113  dd mon yyyy hh:mm:ss:mmm(24h)    
114  hh:mi:ss:mmm(24h)    
20 or 120  yyyy-mm-dd hh:mi:ss(24h)    
21 or 121  yyyy-mm-dd hh:mi:ss.mmm(24h)    
126  yyyy-mm-dd Thh:mm:ss.mmm(no spaces)    
130  dd mon yyyy hh:mi:ss:mmmAM    
131  dd/mm/yy hh:mi:ss:mmmAM  


MS Access :-

Format(a.sent_date,'dd-MMM-yyyy') as Email_Date
 
 
 
Prev Post                                                      All Post                                                           Next Post

1 comment: