|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I have a table that imports data from text files, and the dates come
in as YYYYMMDD into a varchar column. I need to compare those dates to a column in an existing table that is date format YYYY-MM-DD I was thinking that CONVERT(DATETIME,temp_table_field) = 'existing_table_field' but keep getting a syntax error. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 21 Dec, 14:23, Steve <steve.lo...@gmail.com> wrote:
> I have a table that imports data from text files, and the dates come > in as YYYYMMDD into a varchar column. > > I need to compare those dates to a column in an existing table that is > date format YYYY-MM-DD > > I was thinking that CONVERT(DATETIME,temp_table_field) = > 'existing_table_field' but keep getting a syntax error. Is the column in the existing column a date column or a char/varchar column containing a string representation of a date? If it is the former, the date column does not have a format of YYYY-MM- DD, it has MySQL's internal date format. It can however be viewed in any number of formats. |
|
![]() |
| Outils de la discussion | |
|
|