troubleshooting Question

How to format and concatenate fields in an SQL server view

Avatar of dsoderstrom
dsoderstrom asked on
Microsoft AccessMicrosoft SQL Server 2005
3 Comments1 Solution401 ViewsLast Modified:
I am creating a view in an SQL server database and need to combine two fields to create a new field.  The two fields are AccountingPeriod which is a a smallint field which can contain the values 0 through 12 and AccountingYear which is a smallint field containing the four digit year.
I want to use these fields to create a new char(4) field which is the period and the last two digits of the year (ex. AccountingPeriod 3 and AccountingYear 2011 would become "0311")
What is the syntax that I would use to create this field

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros