Solved

SQL 2000 View Syntax

Posted on 2012-03-29
2
312 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
sql query 7 37
sql query to reportserver  table error 3 24
SQL Inner Join Vs SubQueries 9 26
Fixed Length SQL Query Question 3 14
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
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 to return specific rows and columns, with various degrees of sorting and limits in place.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now