Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL++ - Programming with the C++ API to MySQL
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Datatype Conversion Within a SQL Statement

Datatype Conversion Within a SQL Statement

2006-12-19       - By Frank Reinprecht

 Back
Reply:     1     2     3     4     5  

Dear readers,

I'm using sapdb 7.4 (I know it is a little bit old, but it works for me)
on a windows 2000 server. I made a mistake and filled the delivery date
of a customer-position with a wrong value. It was the wrong year.
So I used the following statement for correcting the year from 2006 to 2007.

update k_sonder_pos set liefertermin = Date('2007' &
SUBSTR(liefertermin,5,10)) where
liefertermin <= '2006-01-31' and liefertermin >= '2006-01-01'

This works as I expected very fine. But I now have the problem, that the
dates are shifted by one day. The 01.01.2006 is a sunday, and not like
the 01.01.2007 a monday. So I want decrease all the dates a day.

I tried different things, but without a conversion from string to number
and reverse I'm not able to solve it, I guess. Is there any possibility
to do so?

If anybody can help me out with this, please don't hesitate. I'm
thankfully for any hints!

Again thanks in advance!

Frank

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/maxdb?unsub=mysql@(protected)