Transposing an Excel date to a MySQL long
- FlowHeater-Team
- Topic Author
- Offline
- Admin
Less
More
14 years 1 week ago #2069
by FlowHeater-Team
Best wishes
Robert Stark
Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
Transposing an Excel date to a MySQL long was created by FlowHeater-Team
Translated submission in the German forum. You can read the original entry
here
.
Hi,
I want to import data from an Excel workbook into a MySQL database table.
This means an Excel date field with the format "dd.mm.yyyy" must be input to a MySQL long integer with the format "yyyymmdd".
Is there an easy way to do this?
Thanks in advance,
Alfred Schmidt
Hi,
I want to import data from an Excel workbook into a MySQL database table.
This means an Excel date field with the format "dd.mm.yyyy" must be input to a MySQL long integer with the format "yyyymmdd".
Is there an easy way to do this?
Thanks in advance,
Alfred Schmidt
Best wishes
Robert Stark
Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
- Topic Author
- Offline
- Admin
14 years 1 week ago #2070
by FlowHeater-Team
Best wishes
Robert Stark
Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
Replied by FlowHeater-Team on topic Re:Transposing an Excel date to a MySQL long
hi alfred,
you can do that with the help of the format heater and the built-in adapter data type conversion .
to make it easy to visualize we have written a brief example for you, see the attachment.
you can do that with the help of the format heater and the built-in adapter data type conversion .
- if your excel field is defined as a date, you do not need to do anything further on the read side, so proceed with step 2. however, if the date field is defined as a string, you have to ensure the adapter format settings comply with the actual date format in the excel file. normally you need no special settings here either, because flowheater uses the standard locale settings of the computer when creating a new definition. for a german setup this is already set to dd.mm.yyyy.
- now you have to first convert the date into a string. to do this you use the format heater with settings as in the screenshot. the format heater now converts the date into a string e.g. 20101005.
- you simply connect the output string so formatted to the mysql long field . at this point the data type conversion of flowheater cuts in and the value is automatically converted from a string to a number.
to make it easy to visualize we have written a brief example for you, see the attachment.
Attachment excel_date_mysql_long.zip not found
Best wishes
Robert Stark
Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
Attachments:
Please Log in or Create an account to join the conversation.
Time to create page: 0.263 seconds