Sql query to replace date

Closed
sidhu - Sep 3, 2010 at 11:44 PM
wingamer Posts 5 Registration date Friday January 7, 2011 Status Member Last seen January 7, 2011 - Jan 7, 2011 at 06:08 AM
Hello,


Hi,In my data base sqlserver my date format is mm/dd/yy but i have to retrive the data by using month and year ,i.e is have three drop downlist in which im going to select only month and year.

1 response

wingamer Posts 5 Registration date Friday January 7, 2011 Status Member Last seen January 7, 2011
Jan 7, 2011 at 06:08 AM
Please try this

select 
	[YEAR] = YEAR([date]), 
	[MONTH] = MONTH([date]), 
	[DAY] = DAY([date]),
	*
from dates

0