• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to format date in ms sql

 
ruchz, briones
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone tell me please how to format date in ms mssql? i tried this query
Select Format(DateOpened,'yyyy-mm-dd') from tblaccounts
but got the error
'Format' is not a recognized built-in function name. Severity 15, State 10, Procedure 'WPT1 null', Line 1
Hope ypu can take some time on my inquiry. Thanks in advance
 
Peter Guillebaud
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try
SELECT CONVERT ( CHAR (17), DateOpened )from tblAccounts
hope this helps. You can change the (17) to restrict or to increase the 'size' of the format returned
 
ruchz, briones
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got it! big thank
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic