Looking for field controlling "Don’t show corrections"

SOLVED

Hello everyone,

I have exported data from Sage 50 to Microsoft Access through ODBC. In Sage, whenever we produce reports, for example Project Income, we have an option to check or uncheck show "Corrections". Which field controls for this boolean switch and in which table? I figured it has something to do with the ntype field in tJourEnt table because its function is to show journal entry type but this doesn't account for the whole inclusion/exclusion from reports. Anybody can help with this? Thanks so much.

  • 0

    Marc

    You are correct tjourent.nType identifies any entry.  Any number 32 and over is a correction of some sort.  This field is used for General Journal, General Ledger, Project detail reports and any other report with the check box Show Corrections.

    There is no "flag" field to include or not include them in reports in the tjourent table as that is an option when running the report.  It is not information that would be stored in the database.

    However, if you want to get really deep into the myriad of tables and fields, you will have to trace which report is which in the database to figure out if the check box Show Corrections is actually checked or not checked for the specific report you want.

    You will want to look at trptopts.szChkOptn and look at the fifth character when trptopts.lUserId = the correct username, lRptType = 271 (Project Income Detail), etc.  If the fifth character is 1 (One) then it is checked, zero is unchecked.

    This latter part is all undocumented.

  • 0 in reply to Richard S. Ridings

    Thank you Richard! That's great info. Do you have room for one more? If nType over 32 is a correction of some short, then why is it that when we run a report like Project Income and check off "show corrections" so that they are not included, we still see 32s and 64s and so on?

    More importantly, if there is no switch stored in the table (which makes sense), then it must be that when selecting report parameters, behind then scenes it's actually a form feeding the switch to a query which is using it as a filter to exclude or include the corrections. What might that filter be?

    Basically I am trying to reproduce the boolean checkbox in Microsoft Access after having imported the data through ODBC.

  • 0 in reply to Marc Adjami
    SUGGESTED

    Sorry, I read you original message that you were looking for the flag itself, which I indicated was in the trptopts table.

    when we run a report like Project Income and check off "show corrections" so that they are not included, we still see 32s and 64s and so on?

    First, because you are now talking about two different programs, you must tell us which program you are referring to.  Help us help you.

    Now I have to assume you mean Sage 50.  And if I am correct, you are using the checkbox incorrectly.  Think of Show Corrections as the statement, I want to see corrections.  If it is checked, then Yes, I want to see corrections.  If it is unchecked, then I do not want to see corrections.

    If blnCorrections Then
    	strCorr = " AND `nType` >= 0"
    Else
    	strCorr = " AND `nType` < 30"
    End If

    The above code is part of what I use in one of my programs to build a WHERE clause of my SQL statement that either shows or does not show corrections.  This is not the whole statement as I have other parameters being added in (eg. Date range) but it is how I build the clause.  There are other ways to do this including hard-coded selection to always ignore or always show, but it sounds like you need the option and this is one way to do it.

    The checkbox in your Access program should feed into something like my blnCorrections boolean variable and you can build your SQL statement in the same manner.

  • +1 in reply to Richard S. Ridings
    verified answer

    I was referring to Sage 50. Your answer above helps out a lot for what I need to get done right now. Thanks so much Richard! :)

  • 0 in reply to Marc Adjami

    Hi , if the above suggested answer resolves your issue, please mark the reply with answer verified  White check mark thank you!