Hello Chris
Thanks for the hints!
chris.gruber:
You may want to look at the convert/dateformat functions as these can process a variety of date formats.
I tried various statements but I can’t get it to work
for example:
insert into periods (is_current,fraction_name, CONVERT(DATE, from_date, 104),school_year,CONVERT(DATE, to_date, 104)) values (‘0’,‘HS’,‘1.8.2003’,‘2003’,‘31.1.2004’);
Do you mean by convert/dateformat something as the above stmt. And what’s wrong with that statement?
chris.gruber:
Alternatively to avoid using any functions, and use the date_order option.
set option date_order=‘dmy’;
How to set this permanently (until I set it again) in Interactive SQL? Just as mentioned above?
Thanks and best regards, Robert
…
insert into … VALUES (to_date(‘26.06.2006’,‘DD.MM.YYYY’), 1, …);
or
set option date_order=‘mdy’;
…
insert into … VALUES (to_date(‘06.26.2006’,‘DD.MM.YYYY’), 1, …);
Note that the default date_order option is ‘ymd’;
SQL Anywhere will implicitly convert to dates if you provide the proper order in the date format.[/quote]