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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Previouse Record

Status
Not open for further replies.

anushka04

Technical User
Jul 7, 2005
28
GB
Hi i have the following data i am trying to retreve using a link report.

CPY_0 DEDRAT_0 STRDAT_0 VAT_0 VATRAT_0
100 01-Jan-99 EXE 0
100 01-Jan-99 EXP 0
100 01-Jan-99 IRR 0
100 01-Jan-99 STD 17.5
100 01-Jan-99 ZER 0
100 01-Jan-99 OSS 0
100 25-Nov-08 STD 15


in the link report i am grouping on STRDAT_0 and passing CPY_0,STRDAT_0 and VAT_0 values.

i have the following in a formula in details section :


if ({TABRATVAT.CPY_0} = {?Pm-SINVOICE.CPY_0} and {TABRATVAT.STRDAT_0} <= {?Pm-SINVOICE.ACCDAT_0} and OnfirstRecord) then {TABRATVAT.VATRAT_0}
Else
if ({TABRATVAT.CPY_0} = {?Pm-SINVOICE.CPY_0} and {TABRATVAT.STRDAT_0} <= {?Pm-SINVOICE.ACCDAT_0} and PREVIOUS ({TABRATVAT.STRDAT_0}) >= {?Pm-SINVOICE.ACCDAT_0}) then {TABRATVAT.VATRAT_0}
Else
if ({TABRATVAT.CPY_0} = " " and {TABRATVAT.STRDAT_0} <= {?Pm-SINVOICE.ACCDAT_0} and OnfirstRecord) then {TABRATVAT.VATRAT_0}
Else
if ({TABRATVAT.CPY_0} = " " and {TABRATVAT.STRDAT_0} <= {?Pm-SINVOICE.ACCDAT_0} and PREVIOUS ({TABRATVAT.STRDAT_0}) >= {?Pm-SINVOICE.ACCDAT_0}) then {TABRATVAT.VATRAT_0};



unfortunatley the value its returning is 17.5 and i need 15

any ideas please


cr 8.5
db Oracle

 
If you want to use Previous and compare your STD rates then you must sort your data by STRDAT_0 and DEDRAT_0 ascending.

Just as an aside the new VAT rate does not come into effect until 1 December 08. Any invoices you raise in Novemeber 2008 should be at 17.5%.

Ian
 
no value in DEDRAT_0, i am alreday soritng this in STRDAT_0, but dor some reason it will not sort.

tried to convert the value to a date but it willnot accept
 
Sorry your columns were misaligend, sort by
VAT_0
STRDAT_0

In that priority, if you have grouping on then that will take precedence over your Sorts.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top