Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter / Date Question - Please Help

Status
Not open for further replies.

643hd5

MIS
May 29, 2003
2
0
0
US
Hi there. I'm a relatively newbie to MS. I'm having difficulty in trying to create a filter that will dynamically retrieve the first and last day of a previous month. This filter will then be used to retrieve data for that period (first thru last day of the previous month) How do I go about in doing so? Applycomparison? Any assistance will be greatly appreciated. Thank you.
 
There are a few ways to go about doing this.
1. If you need all the days of the previous month why not just use a dynamic date filter that uses "between" 1st day and last day.

2. If you want to use database functions you can filter on the Month and use an Applysimple to get the previous month. For example in oracle it would look something like [tt] ApplySimple("to_number(to_char(Add_months((SYSDATE-1),-1), 'YYYYMM' ))",0) [/tt] This qualifies on the Month attribute id and the id has to have the format of YYYYMM

3. Another option is similar to # 2 except you use a between and pick the first date you want and the last day you want using the ApplySimple again. This would qualify on the date attribute, again depending on what form in the attribute you wantto qualify on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top