Filter Stage using sysdate in WHERE clause

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
urahul
Participant
Posts: 9
Joined: Tue Dec 07, 2004 12:44 pm

Filter Stage using sysdate in WHERE clause

Post by urahul »

Hi,
I am using filter stage to filter out records based on a date filed.
In order to select the latest day's records i would like to use sysdate.
Can anybody please help me with the same, because it seems sysdate doesnt work with DataStage.
The condition in where goes like this:
DATE_FILED > SYSDATE

Thanks
Rahul
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

The current date can be obtained using Date functions available in PX. You may need to reformat the result.

HTWH.

Regards
Saravanan
urahul
Participant
Posts: 9
Joined: Tue Dec 07, 2004 12:44 pm

Post by urahul »

Hi,
Can we use DataStage DATE function in Filter Stage?
if yes could you please let me know how.

Thanks
Rahul
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

DATE function cannot be used in the filter stage as filter stage is a PX stage.

Look at the document which date functions can be used in PX stages.

Regards
Saravanan
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

You could use the Column Generator Stage to add a date column that contains the current date (the 'Use Current Date' option in the Column Meta Data editor).

Then your Filter Stage uses a where clause the compares your input date to the new current date field.
Post Reply