Page Index Toggle Pages: 1 [2] 3  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Using Pipes in Retrieve Specs (Read 3857 times)
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Piping
Reply #15 - Sep 19th, 2007 at 3:30pm
Print Post Print Post  
Infinity wrote on Sep 19th, 2007 at 1:58pm:
Wow, you are amazing.  The one for last month nicely retrieves August.  I'll put it in play and see what happens in January.  Thanks Ray!



If it works for August, then it's going to work For January. I wrote it from memory and thought I had forgot something. Just so that you know what it is doing. The Statement
Code
Select All
@Date-@DOM(@Date) 

takes you back to the last day of the month before this one. So the Year and the Month statements will return the Year and Month of the last day of the month before this one.

-Ray
  

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


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Using Pipes in Retrieve Specs
Reply #16 - Sep 19th, 2007 at 11:05pm
Print Post Print Post  
Temporarily change your system date to January to test it out.

Remember to change it back again.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Using Pipes in Retrieve Specs
Reply #17 - Sep 20th, 2007 at 12:12am
Print Post Print Post  
Bob_Hansen wrote on Sep 19th, 2007 at 11:05pm:
Temporarily change your system date to January to test it out.

Remember to change it back again.

A safer method (more work, but safer) is to replace @Date with @GlobalValue("TestDate"), which would be set with something like GlobalValue("TestDate", "2008/01/10").

EDIT: Alec Mulvey wrote an Inside Sesame article about why you shouldn't change the system date, on page 5 of the July 2006 issue. He suggests using a variable, which is probably better anyway, since it won't leave debris in the GlobalValues table.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Using Pipes in Retrieve Specs
Reply #18 - Sep 20th, 2007 at 4:04am
Print Post Print Post  
Good reminder Carl. and thanks to Alec for the article.  I have used Alec's method and agree with using the format of "yyyy/mm/dd".  Usually the easiest and most reliable.

I had a similar experience where some trial software thought it had been expired, and I had to remove, edit registry values, redownload, and reinstall.  We are lucky that Sesame provides us the tools to do that.  Can't always do that with other programs that need dates/times in the testing.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Using Pipes in Retrieve Specs
Reply #19 - Sep 20th, 2007 at 1:02pm
Print Post Print Post  
Quote:
EDIT: Alec Mulvey wrote an Inside Sesame article about why you shouldn't change the system date, on page 5 of the July 2006 issue. He suggests using a variable, which is probably better anyway, since it won't leave debris in the GlobalValues table.


In this case you would have to use a GlobalValue or a hardcoded date as it is Retrieve Spec programming that does not have variables.

-Ray
  

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



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Using Pipes in Retrieve Specs
Reply #20 - Sep 21st, 2007 at 12:01am
Print Post Print Post  
Quote:
In this case you would have to use a GlobalValue or a hardcoded date as it is Retrieve Spec programming that does not have variables.

Oh, yeah. Thanks for reminding me why I suggested GlobalValues in the first place. Cheesy
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Using Pipes in Retrieve Specs
Reply #21 - Sep 23rd, 2010 at 11:28am
Print Post Print Post  
Hello!
How to use the pipe to retrieve last week or this week:
Now i use for this week retrieve: { Eingang > @Date - @Dow(@Date) AND Eingang <= @Date - @Dow(@Date) +7 }

Thank you for the help.

Dr. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Using Pipes in Retrieve Specs
Reply #22 - Sep 23rd, 2010 at 12:12pm
Print Post Print Post  
Your example only retrieves this week's records. The first half needs to have a "-7" in there, like this:
Code
Select All
{ Eingang > @Date - @Dow(@Date) -7 AND Eingang <= @Date - @Dow(@Date) +7 } 



Which can then be put inside pipes like this:
Code
Select All
>|@Date - @Dow(@Date) -7|..<=|@Date - @Dow(@Date) +7| 



Note that it must be placed in the Eingang LE.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Using Pipes in Retrieve Specs
Reply #23 - Sep 23rd, 2010 at 12:16pm
Print Post Print Post  
Hello Carl!

>|@Date - @Dow(@Date) -7|..<=|@Date - @Dow(@Date) +7|  this give the last seven days.

>|@Date - @Dow(@Date)|..<=|@Date - @Dow(@Date) +7| to  retrieve the days of this week.

thanks.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Using Pipes in Retrieve Specs
Reply #24 - Sep 23rd, 2010 at 12:50pm
Print Post Print Post  
Quote:
>|@Date - @Dow(@Date) -7|..<=|@Date - @Dow(@Date) +7|  this give the last seven days.

Actually, to clarity, this will find all of last week AND all of this week - not just the last 7 days. Meaning as of today (09/23/2010) it will find dates from 09/13/2010 through 09/26/2010, which also includes dates a few days into the future.

Quote:
>|@Date - @Dow(@Date)|..<=|@Date - @Dow(@Date) +7| to  retrieve the days of this week.

Again, as of today (09/23/2010), this will find dates from 09/20/2010 through 09/26/2010. This one is like you indicated, but I wanted to clarify it for onlookers.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Using Pipes in Retrieve Specs
Reply #25 - Feb 28th, 2011 at 8:57pm
Print Post Print Post  
Waaay back when, Ray wrote:

Quote:
I think this will give you last months
Code
Select All
]|@Year(@Date-@DOM(@Date))|/|@Right("00" + @Str(@Month(@Date-@DOM(@Date))), 2)|/..   



How would I adapt this to show 2 month's ago?  I've tried putting "-1" inside various parenthesis, but I can't get it to retrieve anything from December.  Is it because the year changed?

Thanks for your help.
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Using Pipes in Retrieve Specs
Reply #26 - Feb 28th, 2011 at 9:07pm
Print Post Print Post  
Answering my owe  question, it does fail because the year changed.  Changing my system time and using the following will retrieve January's invoices:

Code
Select All
]|@Year(@Date-@DOM(@Date))|/|@Right("00" + @Str(@Month(@Date-@DOM(@Date))-1), 2)|/.. 



Is there a generic fix that retrieve two months ago in spite of the year change?

Thanks again for your help.
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Using Pipes in Retrieve Specs
Reply #27 - Feb 28th, 2011 at 9:28pm
Print Post Print Post  
Hello Scott,

Try

Code
Select All
]|@Year(@Date-@DOM(@Date)-@DOM(@Date-@DOM(@Date)))|/|@Right("00" + @Str(@Month(@Date-@DOM(@Date)-@DOM(@Date-@DOM(@Date)))), 2)|/.. 



-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Using Pipes in Retrieve Specs
Reply #28 - Feb 28th, 2011 at 9:46pm
Print Post Print Post  
BOOYAH!  Ray, you are the BEST!  Works like a charm!

(When you've got a minute, could you break down what it's doing?  Thanks!)
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: Using Pipes in Retrieve Specs
Reply #29 - Feb 28th, 2011 at 10:03pm
Print Post Print Post  
Hello Scott,

I'll try to take a few minutes tomorrow and break it down for you.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send Topic Send Topic Print Print