I am getting an error using the following script generated via Action Scripting.
The error is "invalid filter expression".
Using file that contains consecutive dates from November 1, 2008 until March 1, 2009, I am hoping to select records of seven days beginning with a prompted date (varialbe vdates). I used the Action script Prompt for Date to create the variable. Thus, vdates="December 8, 2008" as an example. I then used the query "between dates" to try and select records that begin with vdates (Dec 8) and vdates+7 (Dec 14). I tried the formula date()+7 in the Code editor and got the correct result. So, I am confused as to why the Action Script generates an error. Here is the script generated by Action Scripting:
Thanks for looking
The error is "invalid filter expression".
Using file that contains consecutive dates from November 1, 2008 until March 1, 2009, I am hoping to select records of seven days beginning with a prompted date (varialbe vdates). I used the Action script Prompt for Date to create the variable. Thus, vdates="December 8, 2008" as an example. I then used the query "between dates" to try and select records that begin with vdates (Dec 8) and vdates+7 (Dec 14). I tried the formula date()+7 in the Code editor and got the correct result. So, I am confused as to why the Action Script generates an error. Here is the script generated by Action Scripting:
Code:
dim prmpt_title as c dim prmpt_default as c prmpt_title = "Select Beginning Date" prmpt_default = "" vdates = ui_get_date_calendar(prmpt_title,prmpt_default) 'Opens the default Form or Browse layout, displaying all, or selected records in the layout. query.filter = "between(Datenumber,Var->vdates,Var->vdates+7)" query.order = "recno()" 'replace variables in the filter with their actual values query.filter = convert_expression(query.filter,"V") 'Open the default Form showing just the records that satisfy the filter DIM Shared varP_layout as P DIM enable_show_all as l 'The enable_show_all flag turns makes the Show-All button on the form toolbar gray. 'This means that the user cannot turn off the base query for the form. enable_show_all = .f. varP_layout = a5_open_default_Form("day",query.filter,query.order,"Temporary Query","",enable_show_all)
Comment