Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3458

Re: Using a set date formula

$
0
0

Use something like this to get the first of the month three months ago (prompt 1):

 

Date(Year(DateAdd('m', CurrentDate, -3)), Month(DateAdd('m', CurrentDate, -3)), 1)

 

Use this to get the 11th day of the next month (prompt 2):

 

Date(Year(DateAdd('m', CurrentDate, 1)), Month(DateAdd('m', CurrentDate, 1)), 11)

 

Use this to get the last day of the next month (prompt 3):

 

Date(Year(DateAdd('m', CurrentDate, 2)), Month(DateAdd('m', CurrentDate, 2)), 1) -1

 

 

So, your selection formula would look like this:

 

(

{Del_Date} in [Date(Year(DateAdd('m', CurrentDate, -3)), Month(DateAdd('m', CurrentDate, -3)), 1) to

                       Date(Year(DateAdd('m', CurrentDate, 1)), Month(DateAdd('m', CurrentDate, 1)), 11)] or

  (

  {customer} = 'XXX' and

  {DelDate} <= Date(Year(DateAdd('m', CurrentDate, 2)), Month(DateAdd('m', CurrentDate, 2)), 1) -1

  )

)

 

I added extra parentheses around the whole thing in case you  have additional selection criteria.

 

-Dell


Viewing all articles
Browse latest Browse all 3458

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>