By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,233 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 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

NeoPa
Expert Mod 15k+
P: 31,186
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.