Skip to Content
author's profile photo Former Member
Former Member

how to get data for a previous month

I have this date as Number and in YYYYMMDD

I want to run the report automatically after the previous month.

{CLSPAYTP.OTTRND} in 20150401 to 20150430 and

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on May 20, 2015 at 07:50 AM

    Hi Paul,

    See if this works:

    cdate(picture(totext({CLSPAYTP.OTTRND},'#'), 'xxxx/xx/xx')) IN LastFullMonth


    P.S: If the report is based off of a SQL Query, I would recommend adding this to the where clause instead of doing this in the selection formula.

    If the report is based off of a Table/View, you should consider creating a 'SQL Expression' that converts the number field to date and then use that SQL Expression in the selection formula for better performance.


    -Abhilash

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 20, 2015 at 06:16 AM

    Hi Paul,

    please go thorugh the following threads , i hope it would give you some insight.

    http://scn.sap.com/thread/1108650

    and

    http://crystaltricks.com/wordpress/?p=159

    Regards

    Ganesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 20, 2015 at 07:57 AM

    Hi,

    First extract the MM from YYYYMMDD and then get previous month by subtraction i.e, MM - 1.

    And then concatenate it in the format YYYYMMDD and use.

    Ramji

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.