Author Topic: Semi monthly data in report  (Read 1836 times)

Offline kbasha2004

  • Full Member
  • ***
  • Join Date: Sep 2007
  • Posts: 21
  • Forum Citizenship: +0/-0
Semi monthly data in report
« on: 22 Apr 2008 04:25:21 pm »
Hi Friends,

I need to create a report that pull the data for the semi-monthly when it is run on the next day of semi-month.

Jan 1 - Jan 15 data when run on Jan 16.......till Jan 29th

Jan 16- Jan 31 data when run on Feb 1.......till Feb 14th

Feb 1 - Feb 14 data when run on Feb 15.......till Feb 28th

keeping in the mind leap year and also Month with 30 days and 31 days.

friends please help me with reportnet function /logic that will pull the data.



Offline almeids

  • Statesman
  • ******
  • Join Date: Oct 2006
  • Posts: 304
  • Forum Citizenship: +15/-2
Re: Semi monthly data in report
« Reply #1 on: 23 Apr 2008 07:52:19 am »
I think what you really need is a function to tell your employers they're nuts.
Seriously, I don't think there's anything you're going to be able to do to handle leap year within Report Studio.  Given the static nature of the rule, your best bet may be to add a database table to drive this, 366 records with Run date, Start Range Date, End Range Date.  You can use real dates and replace the year in RS, or partial date (month and day) strings and construct the date in RS.
If that's not an option, what database are you on?  You're going to need a way to determine the number of days in the month and vendor-specific functions may help.

Offline GovGuy

  • Associate
  • **
  • Join Date: Sep 2015
  • Posts: 3
  • Forum Citizenship: +0/-0
Re: Semi monthly data in report
« Reply #2 on: 10 Jan 2018 08:30:30 am »
You can use the mod function to determine if a given year is a leap year.  It would look something like this:

Code: [Select]
IF (
MOD(current_date,400)=0 OR ( MOD(current_date,4)=0 AND MOD(current_date,100)<>0 )
('Leap Year')
('Not a Leap Year')