Sage dates in Crystal Reports

I am doing pwFormatDate(ORDDATE) = CurrentDate -1 to obtain yesterdays date and then trying to filter on this date for yesterdays orders. But I need to convert this date back to a Sage date to do the filter. Is there a function that converts back to Sage format? Or is there another way of doing this?

Any clues will be helpful.

Thanks      

Parents Reply
  • 0 in reply to Mike Cook

    Note that using pwformatdate() in a record retrieval is very inefficient, because Crystal has to retrieve all the records before evaluating the function.  Therefore, never do a selection criteria as

    pwformatdate({OEORDH.ORDDATE}) in {dateparm1} to {dateparm2}

    do it as

    {OEORDH.ORDDATE} in tonumber(tostring({dateparm1},"yyyyMMdd")) to tonumber(tostring({dateparm2},"yyyyMMdd"))

    and then Crystal will send the correct SQL query and retrieve much fewer records.  The difference in speed on large databases can be over 1000 to 1.

Children