Alpha Video Training
Results 1 to 5 of 5

Thread: Update tables for specific time periods

  1. #1
    Member
    Real Name
    Andrew Min
    Join Date
    May 2008
    Posts
    9

    Default Update tables for specific time periods

    Hi,

    Not a problem this time, just a question. I currently have a report that finds the differences between the accounts in a trial balance for each month for the entire year (12 months). For this report I have 12 tables (1 for each month's trial balance) and 1 set connecting them all together.

    When I refresh the information for these, I have them setup so they ask for the beginning date and ending date of each month because I couldn't figure out a better way of doing this. Is there a better way to do this? e.g. have a pop-up box that asks for what year I want and it refreshes all 12 tables?

    Thanks,
    Andrew Min

  2. #2
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,573

    Default Re: Update tables for specific time periods

    Andrew

    Good question. Yes there is a way.

    Build a xdialog box with action scripting and make global variables for the dates. Then the user will be prompted once and the global variables can be used repeatedly....
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  3. #3
    Member
    Real Name
    Andrew Min
    Join Date
    May 2008
    Posts
    9

    Default Re: Update tables for specific time periods

    Hi Al,

    Was just wondering what the code is to refresh a passive-link table? I haven't been able to find it. I have been able to build the xdialog box with the global variables, I just need to figure out how to use those now...

    Thanks

  4. #4
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,573

    Default Re: Update tables for specific time periods

    Quote Originally Posted by Amin View Post
    Hi Al,

    Was just wondering what the code is to refresh a passive-link table? I haven't been able to find it. I have been able to build the xdialog box with the global variables, I just need to figure out how to use those now...

    Thanks
    Andrew

    To refresh a passive-link table with an argument from a variable you can copy from this code.

    It's a little technical, but should be something that you can handle.

    Code:
    Given a passive link table called 'customer_by_city' that has a sql query of "select * from customers where city = :whatcity"
    
    to refresh using xbasic:
    
    
    dim args as sql::arguments
    args.add("whatCity",var->vcgCityName)
    p = a5_RefreshPassiveLinkTable("customer_by_city",.f.,.f.,args)
    Hope that helps. Note that the variable is scoped as a global. You can get away with a shared variable but in this case I made it global as over kill...
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  5. #5
    Member
    Real Name
    Andrew Min
    Join Date
    May 2008
    Posts
    9

    Default Re: Update tables for specific time periods

    Hi Al,

    Finally getting back to this project, I've kind of been doing it off and on. I'm trying to use the A5_sql_importdatasource() function because it looked more intuitive to me to be able to choose the sql statement. It does refresh the one table for the right period of time, but I keep getting this "Variable "startTime" not found." error. Is there something I'm missing? I attached my code.

    Code:
    dim sql as C
    dim vYear as N
    dim vMonth as C
    dim ds as P
    dim pr as P
    
    vYear = ui_get_text("Year","What Year is this for?")
    vMonth = ui_get_text("Month","What Month is this for?")
    sql = "sp_report TrialBalance show Credit, Debit, Label Parameters DateFrom = {d'"+vyear+"-"+vmonth+"-01'}, DateTo = {d'"+vyear+"-"+vmonth+"-31'}"
    ds.connectionstring="{A5API='QuickBooks',A5Syntax='QuickBooks',FileName='.',UserName='Admin'}"
    ds.SQLSelectStatement=sql
    pr =a5_sql_importdatasource(ds,"ztb")
    Thanks,
    Andrew

    P.S. I hope this was the right forum to ask this? Should i be posting it in the a5 forum?

Similar Threads

  1. Update Tables by %
    By andymeer@yahoo.co.uk in forum Alpha Five Version 7
    Replies: 5
    Last Post: 11-25-2006, 02:02 PM
  2. Posting Time Periods
    By John Dodson in forum Alpha Five Version 5
    Replies: 2
    Last Post: 09-08-2006, 12:14 PM
  3. Adding up specific records in two tables for one user only
    By cello78 in forum Alpha Five Version 7
    Replies: 1
    Last Post: 01-10-2006, 04:46 PM
  4. Lost periods on export
    By A. R. Sale in forum Alpha Five Version 5
    Replies: 1
    Last Post: 12-20-2002, 05:22 PM
  5. How to update tables ?
    By kim hansen in forum Alpha Five Version 5
    Replies: 1
    Last Post: 12-18-2002, 12:05 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
  •