AnsweredAssumed Answered

Last Week Sales by Client

Question asked by MarshaRupel on May 19, 2012
Latest reply on May 27, 2012 by MarshaRupel

Title

Last Week Sales by Client

Post

Hello!

I am stuck here....I have a layout (Finances) that I have a button (Find Sales Last Week) and also 2 global date fields (g Start Date and g End Date) to do a find by a date range.  The global date fields are in my Transactions table.  I also have the fields: Total Sales Last Week, Total Cost of Goods, Total Shipping, and Total Tax.  They are all summary fields in my Contacts table.  Transactions is linked to Contacts by Client #.

My Find button script is:

Set Error Capture [On]

Enter Find Mode []

Set Field [Line Items::g Start Date; Get ( CurrentDate ) - DayOfWeek ( Get ( CurrentDate )) - 6

Set Field [Line Items::g End Date; Get ( CurrentDate ) - DayOfWeek ( Get ( CurrentDate ))

Perform Find [Restore]  where:

Contacts::Total Sales Last Week = Line Items::g Start Date & ".." & Line Items::g End Date

Contacts::Total Cost of Goods = Line Items::g Start Date & ".." & Line Items::g End Date

Contacts::Total shipping Cost = Line Items::g Start Date & ".." & Line Items::g End Date

Contacts::Total Tax = Line Items::g Start Date & ".." & Line Items::g End Date

If [not Get (FoundCount)]

  Show Custom Dialogue

  Exit Script []

End If

Show All Records

 

A couple of issues here:  my Find button does not return total sales, etc for the prior week nor does entering a date range return any totals and when I click on the tab Finances it goes to another client's record other than the current client I was working with.  Then when I cancel out of the find it goes to the very first record instead of staying on the current record.

 

Any help is appreciated!

 

Outcomes