Normal Topic Automatically retrieving the newest files (Read 584 times)
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Automatically retrieving the newest files
Dec 1st, 2016 at 9:58pm
Print Post Print Post  
I have a file where each record is a new order for samples.  One of the elements in the file is ORDER DATE, formatted as a date "mm/dd/yy".

At the retrieve spec, I'm trying to program a command button to automatically open all orders received in the last ten days.  If I manually enter a date with ">" in front of it in the ORDER DATE element, it works as expected. 

However, when I try to program it, the ">" symbol doesn't get input.  I've proven out the programming to create a string variable such as ">2016/11/20" but when I look at the ORDER DATE I find "2016/11/20".

Is there some programming trick that will work?

Thanks for any help!

NH User
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Automatically retrieving the newest files
Reply #1 - Dec 1st, 2016 at 10:08pm
Print Post Print Post  
Hi Paul,

You have to be a little bit sneaky here as Sbasic sees the element as the date type and we want to put other characters into it(which isn't allowed as dates are strictly dates). But you can use FormFieldValue() to put a value into that element at the retrieve spec(And only at the retrieve spec). Ex:

Code
Select All
FormFieldvalue(@Layout, "ORDER DATE", 0, ">" + @Str(@Date-10)) 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: Automatically retrieving the newest files
Reply #2 - Dec 1st, 2016 at 10:25pm
Print Post Print Post  
Thanks, Ray!

It works great!!
  
Back to top
 
IP Logged