Alpha Video Training
Results 1 to 3 of 3

Thread: Help Needed with Query

  1. #1
    Real Name
    Bruce Roberson
    Join Date
    Mar 2011

    Default Help Needed with Query

    Hello, I am having trouble adding onto an existing query I have used, which currently runs as (exist(trim(Property_No)+trim(Tax_Cde),"RRCETC","RRC")). It is run in a set where one of the tables is Texastx1 where I am querying against the parent RRCETC in this case.

    Here I concatenate too fields that are character fields with Texastx1 to see if that result exists in the table "RRCETC", in the index "RRC". I need to add on to this query to test for an additional situation, but Alpha 5 won't let me get the filter setup correctly for the query. When I combine between(chr(Production_Date),Beg_Date,End_Date)) at the end of (exist(trim(Property_No)+trim(Tax_Cde),"RRCETC","RRC")) to make the combined query read like (exist(trim(Property_No)+trim(Tax_Cde),"RRCETC","RRC")).AND.between(chr(Production_Date),Beg_Date,End_Date)), it said it is invalid.

    So I am wanting a numeric field Production Month to first convert to a character, thus the "chr" function. The resulting of chr(Production_Date) is something like 201811. It needs to check to see that this value is between the Beg_Date and the End_Date. So, if Beg_Date is 201805 and End_Date is something like 201812, then the query would pick the record based on the date being within the range.

    Am I going to have to separate this into a separate Query, or can someone help with this?



  2. #2
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Join Date
    Mar 2006
    Los Angeles

    Default Re: Help Needed with Query

    Its a bit difficult to tell what the field values actually are that you are trying to query.
    Is Production_date a date field in the format mm/dd/yyyy ? Because your vars Beg_Date and End_Date are shown as being yyyymm
    Perhaps some actual sample data of what your field values would be in this string would help us to help you figure it out.

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  3. #3
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001

    Default Re: Help Needed with Query

    Try using time("yyyyMM",date()) instead of chr(Production_Date), or assuming all 3 values are actual date values by default between(time("yyyyMM",production_date),time("yyyyMM",beg_date),time("yyyyMM",end_date))

Similar Threads

  1. help needed with table query
    By kamey in forum QReportBuilder
    Replies: 6
    Last Post: 08-22-2013, 10:46 PM
  2. Help needed with basic Ajax callback and SQL Query in Dialog2
    By WindForce in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 02-01-2012, 10:22 PM
  3. Help needed creating query filter
    By sicomputerguy in forum Alpha Five Version 7
    Replies: 7
    Last Post: 02-25-2007, 01:32 PM
  4. Query Help Needed
    By dtheo in forum Alpha Five Version 5
    Replies: 9
    Last Post: 06-02-2003, 04:02 AM
  5. Query filter help needed
    By tlyon in forum Alpha Five Version 4
    Replies: 16
    Last Post: 05-20-2002, 03:06 AM


Posting Permissions

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