Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Expression 2

Status
Not open for further replies.

cosmoh2o

Programmer
Jul 22, 2002
92
0
0
US
Please help,

I have a value coming from a query in a report that is of the form "yearmonth" (the 4 character year is concantenated with the 2 character month - e.g. "200401" for January 2004) and I want to "parse" the value so that only the last two characters are displayed on the report (the month). Is there a simple way to do this inside ReportStudio with a report expression?

Thanks to anyone with any idea of how to do this.
 
Using substring(datefield, 5, 2) should do the trick. This extracts 2 characters from datefield, starting at the 5th character (this is assuming that your date fields are all 6 characters)

J
 
You could also use Right(datefield,2)

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Thanks to both JGirl and GJParker!! I will try both.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top