Alpha Video Training
Results 1 to 6 of 6

Thread: TableSum in dbf field?

  1. #1
    Member
    Real Name
    Jim Specht
    Join Date
    Oct 2005
    Location
    Northeast PA
    Posts
    129

    Default TableSum in dbf field?

    When I place a TableSum command in an Inv_Item dbf field, I see the result correctly in the field expression builder, however, when I save it, then try to use the field on a form, it returns 0.

    command is TABLESUM("INV_TRANS.DBF","STOCK_CODE="+QUOTE(INV_ITEM->STOCK_CODE)+" .AND. QTY_SOLD<>0 .AND. (EA_FLAG='E') .AND. {"+DTOC(DATE())+"}-DATE<=365","QTY_SOLD")

    Why might this not be working as expected?

    Jim S

  2. #2
    Member
    Real Name
    Jon P Moody
    Join Date
    Nov 2016
    Posts
    153

    Default Re: TableSum in dbf field?

    Jim {"+DTOC(DATE())+"}-DATE<=365 doesn't look good to me...

    1. Do you have a field called DATE?
    2. Can you not just use DATE()-DATE<=365

  3. #3
    Member
    Real Name
    Jim Specht
    Join Date
    Oct 2005
    Location
    Northeast PA
    Posts
    129

    Default Re: TableSum in dbf field?

    Quote Originally Posted by armasoft View Post
    Jim {"+DTOC(DATE())+"}-DATE<=365 doesn't look good to me...

    1. Do you have a field called DATE?
    2. Can you not just use DATE()-DATE<=365
    I do. This part of the formula selects transactions with sales date <= 365 days from today.

  4. #4
    Member
    Real Name
    Jim Specht
    Join Date
    Oct 2005
    Location
    Northeast PA
    Posts
    129

    Default Re: TableSum in dbf field?

    I use this formula as a calculated field in a form (and it works OK), but now want to have it as a dbf field so as to use the result to trigger another action.
    Last edited by jas102; 07-19-2019 at 08:40 AM.

  5. #5
    Member
    Real Name
    Jim Specht
    Join Date
    Oct 2005
    Location
    Northeast PA
    Posts
    129

    Default Re: TableSum in dbf field?

    Disregard. Recalculating fields seems to have resolved.

  6. #6
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,190

    Default Re: TableSum in dbf field?

    I believe Jon is right that you should just be able to make it DATE()-DATE<=365
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

Similar Threads

  1. tablesum() help on forms calc field
    By DaveM in forum Windows Desktop Applications
    Replies: 6
    Last Post: 08-22-2014, 03:48 PM
  2. TableSum / DbSum in Grid CUSTOM FIELD
    By aburningflame in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 03-06-2013, 11:24 PM
  3. Tablesum() again!
    By Nigel Wookey in forum Alpha Five Version 9 - Desktop Applications
    Replies: 6
    Last Post: 09-30-2010, 10:03 AM
  4. calculated field delay using tablesum()
    By jbrooks99 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 9
    Last Post: 12-25-2008, 10:55 AM
  5. tablesum()
    By Frank Calandro in forum Alpha Five Version 7
    Replies: 4
    Last Post: 02-18-2007, 08:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •