Filter stage date condition

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kpsita
Participant
Posts: 99
Joined: Tue Jul 21, 2009 11:43 pm

Filter stage date condition

Post by kpsita »

Hi,

I have a requirement where DATE_FIELD is between Date1 and Date2. For this I am using the following function in filter stage.
DATE_FIELD >= Date1 AND DATE_FIELD <= Date2

All my fields are from database with Data (10) in the format YYYY-MM-DD. I wanted to know if the function used in FILTER stage is correct, or should I use transformer to first convert into YYYYMMDD and then use contraint to check the condition.

i tested and looks like working fine with the filter stage, but wnated to make sure if the function used is correct.

thanks
KPSITA
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

If your date is in the format YYYY-MM-DD, then you are fine with your condition in Filter stage.
You are the creator of your destiny - Swami Vivekananda
sridinesh2009
Participant
Posts: 14
Joined: Wed Nov 11, 2009 4:52 am
Location: New York

Post by sridinesh2009 »

If your source is database...
better you can write a query for fetching records of that range.. from database
Dinesh.D
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't know if it is "better" or not, but if their requirement is to do it "in job" then as anbu noted (with the caveat regarding their string format) what they are doing is just fine - dashes or no dashes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply