SQL 2000 View Syntax

Posted on 2012-03-29
Medium Priority
Last Modified: 2012-03-29
I have a date field (Format datetime length 8) and want to convert it to

YearMonth e.g. 201203

Can anyone help?
Question by:HKFuey
  • 2

Accepted Solution

HKFuey earned 0 total points
ID: 37780774
OK sussed it: -
CONVERT(VARCHAR(7), dbo.MyTable.MyDate, 111) AS YearMonth

Returns 2012/03

Author Closing Comment

ID: 37780777

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question