New call-to-action
Results 1 to 6 of 6

Thread: problem with selecting records by date

  1. #1
    Member
    Real Name
    Reva Reck
    Join Date
    Feb 2006
    Location
    Warwick, Mass. - in the woods
    Posts
    73

    Default problem with selecting records by date

    I'm using an xdialog box to get a date & a location, and then trying to filter records for an append operation based on these fields. Within the dialog box, I've tried using a date text entry, a calendar entry, and specifying the variable as character so I could use a record list list box, then convert the date to character. At one point, this was working. Now I'm told that my filter expression is invalid. I've tried everything I can think of. Could someone show me how to use a dialogue box to get a date parameter I can then use in an operation as a filter? I can post the whole DB if necessary - just let me know what you want to see. HELP! Thanks, Reva

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,322

    Default Re: problem with selecting records by date

    Perhaps a good starting point would be to show us the exact filter expression that throws the error, and explain for us the data type and content of each element in the expression.

    -- tom

  3. #3
    Member
    Real Name
    Reva Reck
    Join Date
    Feb 2006
    Location
    Warwick, Mass. - in the woods
    Posts
    73

    Default Re: problem with selecting records by date

    In the current version, lapdate & laploc are both C variables.
    In the append operation, the filter expression is:
    coursereg->Date=ctod(Var->LapDate ).AND.coursereg->Location=Var->lapLoc
    date is a date variable & location is a character variable
    lapdate & laploc are both pulled down from the the coursereg file using a record list list box.

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,322

    Default Re: problem with selecting records by date

    Reva,

    1) suggest you verify neither lapdate or laploc have any trailing blank spaces

    2) is it possible that the variables are not in scope when the operation is run? Try making them global.

    -- t

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

    Default Re: problem with selecting records by date

    Quote Originally Posted by Reva
    In the current version, lapdate & laploc are both C variables.
    In the append operation, the filter expression is:
    coursereg->Date=ctod(Var->LapDate ).AND.coursereg->Location=Var->lapLoc
    date is a date variable & location is a character variable
    lapdate & laploc are both pulled down from the the coursereg file using a record list list box.
    Reva,
    Maybe I am missing something, but a record list-list dialog box I believe would produces a single variable from the list choice. To acquire 2 variables, lapdate & laploc, I'm thinking more than a record list-list dialog box would be needed. Might this play into your probem?

    Mike W

  6. #6
    VAR
    Real Name
    Cheryl Lemire
    Join Date
    Jul 2003
    Location
    Pembroke Pines, FL
    Posts
    2,914

    Default Re: problem with selecting records by date

    Try formatting the date variable in the xdialog

    Code:
    DIM global LapDate as D
    DIM SHARED varC_result as C
    
    heading_string = "Enter the date here:"
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    LapDate = date()
    varC_result = ui_dlg_box("Select Date",<<%dlg%
    {region}
    {text=30,2:heading_string};
    {endregion};
    {region}
    Date:| [%DATE%.12LapDate!LapDate_*];
    {endregion};
    {line=1,0};
    {region}
    <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
    
    {endregion};
    %dlg%,<<%code%
    if left(a_dlg_button,9) = "LapDate_" then 
        if a_dlg_button = "LapDate_killfocus" then 
            LapDate = ctod(dtoc(LapDate))
        end if 
        a_dlg_button = ""
    end if 
    
    %code%)
    Your filter should be:

    Code:
    coursereg->Date=Var->LapDate .AND. coursereg->Location=Var->lapLoc
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

Similar Threads

  1. Selecting Records to Print
    By Charles Hoens in forum Alpha Five Version 6
    Replies: 9
    Last Post: 12-30-2005, 11:52 AM
  2. Selecting child records
    By jeffe in forum Alpha Five Version 5
    Replies: 3
    Last Post: 07-17-2005, 05:54 PM
  3. Problem selecting multiple records
    By walhoney in forum Alpha Five Version 5
    Replies: 3
    Last Post: 07-28-2003, 06:46 AM
  4. selecting records
    By Ernest Paushter in forum Alpha Five Version 5
    Replies: 1
    Last Post: 02-13-2003, 06:55 AM
  5. Query Selecting All Records
    By Phil Rolf in forum Alpha Five Version 4
    Replies: 10
    Last Post: 03-17-2002, 06:16 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
  •