Crystal Version: 8.5
Datasource: Advantage SQL
I’m writing a Stale Inventory report that is using a parameter for Days Stale based upon a string field {Sales.DateSold}
@NoSale – if no Sales history, calculates Days Stale based upon Received Date
DateDiff ("d",{@RecToDate} ,CurrentDate )
@SoldtoDate – converts string to date
CDate(Val(Left({SALES.DATE},4)) , Val(Mid({SALES.DATE},5,2)), Val(Right({SALES.DATE},2)))
@DaysOld – when there is a Sales record, calculates Days Stale
DateDiff ("d",{@SoldtoDate} ,CurrentDate )
@Stale – show Days Stale with our without Sales History
If {@DaysOld}>0
then {@DaysOld}
else
{@NoSale}
Select Expert: {@Stale}>={?DaysOld}
Problem: When an inventory item has multiple sales records, based upon the value entered in my ?DaysOld parameter, my report is producing different data. I want only the most recent sales record considered but my report is looking at Days Stale and finding the sales record preceding that point.
Example: SKU 123456
Sold 09/24/2004 – run for DaysOld 30 used as last sold
Sold 08/20/2004 – run for DaysOld 60 used as last sold
Sold 06/19/2002 – run for DaysOld 90 used as last sold
I have attempted to incorporate a Maximum expression in both my formulas and Select Expert but previewing the report returns “Formula cannot be used because it must be evaluated later”. Next tried “whilereadingrecords” and “whileprintingrecords” but must not be using these correctly.
Thanks in advance for any suggestions.
Datasource: Advantage SQL
I’m writing a Stale Inventory report that is using a parameter for Days Stale based upon a string field {Sales.DateSold}
@NoSale – if no Sales history, calculates Days Stale based upon Received Date
DateDiff ("d",{@RecToDate} ,CurrentDate )
@SoldtoDate – converts string to date
CDate(Val(Left({SALES.DATE},4)) , Val(Mid({SALES.DATE},5,2)), Val(Right({SALES.DATE},2)))
@DaysOld – when there is a Sales record, calculates Days Stale
DateDiff ("d",{@SoldtoDate} ,CurrentDate )
@Stale – show Days Stale with our without Sales History
If {@DaysOld}>0
then {@DaysOld}
else
{@NoSale}
Select Expert: {@Stale}>={?DaysOld}
Problem: When an inventory item has multiple sales records, based upon the value entered in my ?DaysOld parameter, my report is producing different data. I want only the most recent sales record considered but my report is looking at Days Stale and finding the sales record preceding that point.
Example: SKU 123456
Sold 09/24/2004 – run for DaysOld 30 used as last sold
Sold 08/20/2004 – run for DaysOld 60 used as last sold
Sold 06/19/2002 – run for DaysOld 90 used as last sold
I have attempted to incorporate a Maximum expression in both my formulas and Select Expert but previewing the report returns “Formula cannot be used because it must be evaluated later”. Next tried “whilereadingrecords” and “whileprintingrecords” but must not be using these correctly.
Thanks in advance for any suggestions.