Hello all!
I'm trying to figure out a funny problem here and hopefully someone can give me a suggestion on how to go about it. Basically I have an incoming date, for example "01/27/1993" (time is negligible). The situation is I'm trying to come up with logic to determine if the date lies within a range of dates. If it is, then it sends a '1' to the following filter transformation to mark for update, otherwise '0'. Here are the details:
Date range is the 6th of a month(for example, 01/06/2005) to the 6th of the next month (02/06/2005), non-inclusive. The current (and only relevant) date range is determined by the current date...for instance today's date is 01/27/2005. Hence the current date range is 01/06/2005 to 02/06/2005.
I've only figured out part of the logic, the "date_diff" function only looks at one aspect of dates, like months or days...not the whole date =/ My code only considers days, I'm trying to figure out the months and years part but can't seem to wrap my mind around it. Any help is appreciated!
TRAIN OF THOUGHT:
The incoming date should be checked to see if it's before or after the 6th of the current month. If it's before, it will set the beginning of the range as the 6th of the previous month and the end of the range as the 6th of the current month. Otherwise it will set the 6th of the current month as the beginning of the range and the 6th of the next month as the end of the range. Then there must be a check to see if the incoming date lies within the range that has been set. If yes set variable to '1', '0' otherwise.
(I may be explaining or making this way more complicated than it probably is. So I hope everyone will bear with me =) )
I'm trying to figure out a funny problem here and hopefully someone can give me a suggestion on how to go about it. Basically I have an incoming date, for example "01/27/1993" (time is negligible). The situation is I'm trying to come up with logic to determine if the date lies within a range of dates. If it is, then it sends a '1' to the following filter transformation to mark for update, otherwise '0'. Here are the details:
Date range is the 6th of a month(for example, 01/06/2005) to the 6th of the next month (02/06/2005), non-inclusive. The current (and only relevant) date range is determined by the current date...for instance today's date is 01/27/2005. Hence the current date range is 01/06/2005 to 02/06/2005.
I've only figured out part of the logic, the "date_diff" function only looks at one aspect of dates, like months or days...not the whole date =/ My code only considers days, I'm trying to figure out the months and years part but can't seem to wrap my mind around it. Any help is appreciated!
TRAIN OF THOUGHT:
The incoming date should be checked to see if it's before or after the 6th of the current month. If it's before, it will set the beginning of the range as the 6th of the previous month and the end of the range as the 6th of the current month. Otherwise it will set the 6th of the current month as the beginning of the range and the 6th of the next month as the end of the range. Then there must be a check to see if the incoming date lies within the range that has been set. If yes set variable to '1', '0' otherwise.
(I may be explaining or making this way more complicated than it probably is. So I hope everyone will bear with me =) )