View previous topic :: View next topic
|
Author |
Message |
sumannaidu
New User
Joined: 21 May 2005 Posts: 13 Location: Bangalore
|
|
|
|
Hi All,
I got a requirement that it extracts data between two given date.
if the week spans falls in two different months for ex:from 30th of july to 5th of august then we will have two datecard output files RPTHDR1 RPTHDR2 .
RPTHDTR1 will have date from 30th july to 31st july.
and RPTHDR2 will have from 1st aug to 5 aug.
and we will be extracting RPTDHR1 data in one file and and RPTDHR2 data in a different file.
can anyone have similar logic which does the same.. please reply me
.........suman |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Suman,
Step1 : Convert your dates to Julian format.
Step 2: Verify last day of the month (in julian) falls with your date range. If it is, then split the week into 'two' ranges.
Caution: Need to be careful for 'Leap years'. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
date logic is usually very tricky expecially for business dates..
is not something that can be done by general use tools/utilities even if
they are as smart as dfsort..
it' s usually related to the concept of "work day",
every country has a calendar with country related holidays,
and some companies have their own holidays
so all said , to compute a working day after or before a certain date
is a little bit complicated, involving not only arithmetic, but also tabular searches |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Where would you like to get the date range/ranges, a parm or from the system date? What format is the date stored in the input file? If you get 2 date ranges (the date range for the first file and the date range for the second file) the compares could be done either with julian dates or with dates in CCYYMMDD format. If the time period did not span months you could put something in the second date range that would not extract anything to the second file. |
|
Back to top |
|
|
|