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

need to query most recent 6months of usage 1

Status
Not open for further replies.

ccclsi

MIS
Jan 11, 2002
11
US
I have a report where i have figured out how to pull the most recent 12 months of part usage, here is the select statement:

{INVENTORY_TRANS.PART_ID} like {?PART_ID} and
{INVENTORY_TRANS.TYPE} = "O" and
{INVENTORY_TRANS.TRANSACTION_DATE} >= dateadd("yyyy", -1, currentdate) and
{INVENTORY_TRANS.CLASS} = "I"

what i need to do now is query most recent 6months of usage. I a having problems with this. Here is formula that does not seem to work:


If {INVENTORY_TRANS.TRANSACTION_DATE} >= dateadd("m", -6, currentdate) then Sum ({INVENTORY_TRANS.QTY}) else 0


Using CR 8.5, on Oracle 8i Db. TIA for your help,, Bill
 
You should use:

If {INVENTORY_TRANS.TRANSACTION_DATE} >= dateadd("m", -6, currentdate) then {INVENTORY_TRANS.QTY}

Then insert a summary on this formula. Your version was saying that when the date is in the last six months, show the sum of ALL quantities.

-LB
 
Thanks a bunch, that worked great. Have a wonderful weekend!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top