Export Access Database to CSV - ms-access

I want to export an access database to csv format. When I open up the csv file in excel the dates are messed up. I have one field with the date. The date fields is fine. I have another field with just the time. The time field is messed up. It shows 12/30/1899 with the correct time. Can any help me to get only the seconds in the second field. Thanks.

Use the following expression in the query you are using to create the data:
Format(TimeField, "hh:mm:ss AMPM")
where TimeField is the name of your field which contains the time.

Related

How to insert date( in different format ) coming from a CSV file to MySQL

I'm inserting a row coming from a CSV file into my SQL database. The birthdate column that I have on the CSV file has a date format like this 10/29/1992, it seems that the Google Sheets that I use to create the CSV file convert it to that format even though I input it like this 1992-10-29, since the latter format is the format in the SQL database for dates.
So I tried importing the CSV file to my table in the database, and it won't insert the birthdate column correctly, it inserts 0000-00-00 and gives me a warning Mysql date warning data truncated. So it seems it's impossible to insert in this format 10/29/1992
What could be the best way to solve this? Without handling this on the backend or server side? Can this be handled in the phpMyAdmin settings or in google sheets so that it won't convert the date I input to a different format?
I just found out that in Google Sheets where I create the CSV file, there's a setting where you can custom format your dates for a date column. I guess that's all I needed so that the date format from the CSV to the MySQL table will match. The setting can be found in Format-> Numbers-> Custom date and time

Excel 2010 data import from mysql

I'm trying to import data from a MySQL database into an Excel workbook via an ODBC Data Source.
I have a big problem with the time(3) fields from MySQL. Excel imports the content not as expected. As first try, Excel cut the milliseconds off. Then I edited the query at the specific fields to:
DATE_FORMAT(jobstat_0.PreProcessingQueued,'%T,%f')
This puts something like:
00:00:00,156000
That's what I expected, but I can not change the format in Excel.
Excel interprets the content as text, and if I change to the specific time format, Excel does not care...
I need to correct that to get Pivot Tables working. As a result there are Divide By Zero errors in my Pivot Table.
May be someone had something like that?

How to ignore exponential notification and get the actual value while importing data from excel into mysql

I have a huge data in Excel. I need to import it into MySQL. I've saved my Excel file as CSV. There are several columns in my table which are having contact numbers. I've sat format for such fields to 'Number' with decimal places zero. When I saved it as CSV, its showing such values of such fields with Exponential Notification E+.
eg. Mobile_Number is 9840741284 but its showing 9.84E+09 in csv.
I am using MySQL Workbench 6.3 CE to view it. If I keep Mobile_Number column's datatype as int then it stores data as "2147483647" in mysql. All the records which are having Exponential sign are showing the same value in mysql which is 2147483647. That's why I changed the data type to varchar(255) from int. Now it showing result 9.84E+09 format. I am trying to import the data using load data infile command.
How to resolve it? Is there any other way to import data from excel to mysql as it is?
I've changed the data type of Mobile_Numbers to bigint rather than only int in mysql. And its working properly. Thanks a lot Adyson for great help.

MySQL CSV (involving timestamps) Import through Workbench

I am trying to import a CSV with columns [ID, timestamp, account, liters]->[#, datetime, #, #] using the MYSQL workbench 6.3. MySQL creates the table fine using the CSV (imports 1 record) and then I reimport the same CSV for data rows. MySQL identifies the columns and matches them with table well. Then it takes a long time and reports that all rows have been imported but table shows no rows.
I have searched forums and seem people had problems with timestamps but the solutions involved using the commandline. Can someone please guide if I should format my csv differently? It's a big pain. Thanks
OK..so this was problem with date format. When I specified the datetime field, I couldn't see a field popping up at the bottom to specify the format as per https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior (screen resolution issues). Anyway, I types in the matching format there and CSV is importing now..Thanks

SSIS - Export data from Excel to sql table

When i am trying to export data from excel to sql table using ssis,the all rows are inserted . But,when i am inserting a data of length greater than 255 to excel it's giving truncation error. In output column i altered it to 500. in External column input i can't alter it. In my excel sheet there is 2808 rows..but when this error is generating its only inserting 1632 rows and whole other rows are getting truncated....
If any one knows about this,please help me..I am really stuck on this....
Thanks..
Try sorting your data by length eg longest first.
Excel import/export is very buggy in SSIS.
Sometimes the only option is to write VBA script and run it from excel itself