system
December 19, 2011, 2:39pm
1
Hi,
Can i convert sysdate function to user defined date format?
I have to enter sysdate in the target column mapping, but output should be displayed in MMDDYYYY format. Currently, i am getting the output in YYYYMMDD.
Please help.
Arun
Arun.K (BOB member since 2011-10-18)
system
December 19, 2011, 3:45pm
2
You might be able to meet your requirement.
Is your output column varchar(8) datatype? If so, use the to_char function. If, however, your target column is a date, the format will be determined by the target database.
Nemesis (BOB member since 2004-06-09)
system
December 19, 2011, 3:58pm
3
You mean to_char(sysdate (),‘MMDDYYYY’)
When i do as above i am getting NULL values in the field.
My target data type is date.
Arun
Arun.K (BOB member since 2011-10-18)
system
December 20, 2011, 7:55am
4
If it is a date, then the mapping is simply sysdate(). A date datatype does not have a format, the conversion from date to string has.
Converting date, datetime datatypes:
What format does a date datatype have, dd/mm/yyyy? dd.mm.yyyy? yyyy-dd-mm??
Answer: None. A date/datetime datatype has no format at all. Only if you use implicit conversion from date to char or vice versa, then you use the database session default format which can be different for each database, even each client connecting to the same database.
Example: print(sysdate());
If you click on validate all you will see you have an implicit conversion from dateti…
Werner Daehn (BOB member since 2004-12-17)
system
December 21, 2011, 3:29pm
5
Thank you Werner.
Arun.K (BOB member since 2011-10-18)