1. Eternity date/date conversion
Thank you very much Joe, Doo, Nick !
Actually I am transforming data from an old database
to a newly designed database.
Basically in one table the from_date is in a format of
20000326, while the to_date SOMETIMES is 00000000 which
means eternity. Actually all the columns in this table
were defined as CHAR.
Now I want to select these dates from this table and
insert them into another table whose date columns are
defined as DATE. So I have to convert those invalid
date format before I insert them into the new table.
I just don't know the syntax for doing this, can you
help me ? Thanks so much
I use
INSERT INTO new_table
(EventNo, Description, FromDate, ToDate)
SELECT CONVERT(INT, poll64.col001), CONVERT(VARCHAR(30), poll64.col002), substring
(poll64.col003, 1, 4)+'/'+substring(poll64.col003, 5, 2)+'/'+substring
poll64.col003, 7, 2), substring(poll64.col004, 1, 4)+'/'+substring(poll64.col004,
5, 2)+'/'+substring poll64.col004, 7, 2)
FROM old_table
But how about in the case of there is 00000000 in the old_table's column 004?
Yuelin
2. ADO, SQLServer, Chinese and VB
3. Julian Date Conversion to SQL Date:
4. ROLAP with 0 agregations or Realtime cubes return nothing...
5. Date Conversion, String to java.util.Date from Access DB
6. ADO with IDS SPL
7. Date to Julian date conversion
8. (DB)ComboBox + MultiSelect + DataSource
9. week(int) to date(date) conversion in SQL
10. Julian/Serial Date conversion
11. Date conversion
12. A Useful Date Conversion Function -- Problem Initializing Default Function Value to Getdate()