Solved

SQL 2000 View Syntax

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Querying data from 3 tables, all with 1 common column 4 36
SSIS with VPN COnnection 2 77
SQL Insert parts by customer 12 34
T-SQL Default value in Select? 5 27
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

778 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