Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQL 2000 View Syntax

Posted on 2012-03-29
2
319 Views
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?
0
Comment
Question by:HKFuey
  • 2
2 Comments
 

Accepted Solution

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

Returns 2012/03
0
 

Author Closing Comment

by:HKFuey
ID: 37780777
Sorted
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

791 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