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 3858 times)
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 #30 - Mar 1st, 2011 at 2:26pm
Print Post Print Post  
Hello Scott,

Since you know what most everything else does I'm going to focus on this part of the syntax that repeats itself

Code
Select All
@Date-@DOM(@Date)-@DOM(@Date-@DOM(@Date)) 



What this does is it goes to the last day of the month 2 months before the current one. And here is how it does that.

Let's use February 28th 2011 as the current date in this example. So let's substitute that in

Code
Select All
2011/02/28 - @DOM(2011/02/28) - @DOM(2011/02/28 - @DOM(2011/02/28)) 



Now let's solve for @DOM() of today's date

Code
Select All
2011/02/28 - 28 - @DOM(2011/02/28 - 28) 



2011/02/28 minus 28 is 2011/01/31 so let's substitute that in

Code
Select All
2011/01/31 - @DOM(2011/01/31) 



Again let's solve for @DOM()

Code
Select All
2011/01/31 - 31 



and we reach the result of

Code
Select All
2010/12/31 



Okay now we know that for February 28th 2011 this piece of code below resolves to 2010/12/31

Code
Select All
@Date-@DOM(@Date)-@DOM(@Date-@DOM(@Date)) 



So let's substitute that into the original piece of code.

Code
Select All
]|@Year(2010/12/31)|/|@Right("00" + @Str(@Month(2010/12/31)), 2)|/..  



Make a bit more sense now?

-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 #31 - Mar 1st, 2011 at 3:32pm
Print Post Print Post  
Wow, that's amazing.  Thanks Ray!
  

**
Captain Infinity
Back to top
IP Logged
 
Page Index Toggle Pages: 1 2 [3] 
Send Topic Send Topic Print Print