By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,960 Members | 2,238 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,960 IT Pros & Developers. It's quick & easy.

date function

P: 1
how to convert date format like dd/mm/yyy of mm/dd/yyyy to only mm/yyyy of yyyy/mm?
Apr 11 '12 #1
Share this Question
Share on Google+
2 Replies

P: 5
If you are trying to do in Sql server, in that case there is not a inbuilt function for this purpose, but you can use given below code:-
Expand|Select|Wrap|Line Numbers
  1. Select CONVERT(VARCHAR(7), getdate(), 111)
Apr 11 '12 #2

Expert Mod 15k+
P: 31,492
If you have a Date field then you can use the Format() function :
Expand|Select|Wrap|Line Numbers
  1. =Format([DateField],'yyyy/mm')
Apr 11 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.