Remove timepart in Date field

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
nelc
Participant
Posts: 23
Joined: Wed Apr 16, 2003 4:34 am

Post by nelc »

Two possible ways:

1)Use Field(input.InputDate, " ", 1,1) to extract based on space delimiter.
2)Left(InLink.TheTimeStamp, 10) to extract the first 10 chars. This was posted in another thread previously.

Hope it helps!
Good Luck!
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
Another idea is, in case you are using native DB stages:
you can define the datetime column as a date type in the source table's scheme.
this will result in getting the internal date representation of DS, which is an integer value, thus truncating the time part from the result set.
if you use the same DS's internal value to load to a target table, again in native stages, using a date data type, it should automatically translate it to the date value for you and there u have it [8D]


Roy R.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

p.s. (on my post)

u can use any Oconv() manipulation on the internal date number to format the date in your flavour in case you don't need to load it back to a db table.

( in case you are not familiour with Oconv search it in the DS help )

Roy R.
Post Reply