importing a text file in Access? - date

I have a large text file containing 4 attributes, I want to import this file in Microsoft access 2013 , but when the data is imported it gives an error
Type Conversion Failure
This error is occurring on Date Time field
The format of Date and Time is like that:
2008-02-02 15:36:08
Here is the sample of the file:
Sample of data

I guess you might have skipped explicitly defining the date format during the import procedure.
During the import process you need to click on advanced. This menu should appear:
you want to make sure that the highlighted fields match the date format in the text file.
EDIT: you will also want to make sure that the field is imported as Data Type Date Time

Related

Arrow date in a pandas column

I am using arrow to get the dates of a single dataframe that has the following structure:
data=['2015', '2016','2017', '2108']
df= pd.DataFrame(data,columns=['time'])
I know that to get the date in arrow is with the following code:
arrow.get('2016')
Have tried to use this:
arrow.get(df['time'])
But it gives me this error: Cannot parse single argument of type <class 'pandas.core.series.Series'>.
How to tell arrow to use the column?
Thanks
Convert the entire series for access later
One option is to use pandas apply on the column. https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.apply.html
df.time = df.time.apply(lambda tm: arrow.get(tm))
Might be a way to do this with converters on load as well, depending on where you are loading from. csv docs for example, https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html
I also wonder why you are using arrow time versus pandas built in datetime type. Once again, depending on how you are loading this data, dtypes could be used to specify datetime.
Convert one value from the series
You need to choose one value instead of providing all values (i.e. the pd.Series)
arrow.get(df.time[1]) would convert 2016 in your example.

Google Sheets Script parseCsv - How to avoid converting text to numbers, data and formulas

I'm using the following code to import a csv file:
var csvData = Utilities.parseCsv(csvFile);
It is working but with some specific numbers, like "2.02" it is converting the text to date.
If I use the File > Import Menu, I'm able to avoid this automatic conversion, but I was not able to set this condition as a parameter on this function above (parseCSV).
Is it possible to use parseCSV and avoid this automatic text to date conversion?
Thank you!

Can Pandas (or Python) recognize today's date?

I was wondering if Pandas can somehow figure out what today's date is allowing me to automate the naming of the html file I create when I use the "df.to_html" method.
Basically I"m trying to read a website using method "pd.read_html", and then save the dataframe as an html file, daily. The name of the html file will be the day's date. (So today is 9/28/2016 and tomorrow will be 10/01/16 and so on ) I'm not particular about the format of the date, so Sept or 09, whichever is okay.
I'm trying to automate this as much as possible, and so far the best I've gotten is, using ".format" which allows me some flexiblity. But I don't know how I can further automate the process.
import pandas as pd
df = pd.read_html('random site')
today_date = 'saved data/{}.html'.format('Sept 28') # I'm saving it in the folder "saved data" with the name as today's date.html.
df.to_html(today_date)
Thanks.
See the datetime module.
specifically: datetime.date.today().isoformat() gives you a string with the current date in ISO 8601 format (‘YYYY-MM-DD’)

What format is required to import a date into google spreadsheet

With the help of "stackoverflow" and it's users I'm using an app to import data into a Google spreadsheet. The problem is I have a date question on the form, and can not manage to import it. If I change the format (in the forms) to text, the data imports as it has been sent from the app, but when I change it back to date, nothing.
I've believe I've tried all the usual date formats (dd/mm/yyyy, mm/dd/yyyy, yyyy/mm/dd, yyyy/dd/mm) as well as yy for the above and also numerical.
I know that the Google form shows the date in the users format and that is not a problem. It shows up correctly in the spreadsheet in my local format (dd/mm/yyyy).
Does anyone know what format the form uses to send the data to the spreadsheet, or anyway to find out.
Thanks in advance.
Ok, after using wikipedia, and trying every different format it works by using the format yyyy-mm-dd

How to set date with time in sxw using python for openerp report?

I am generation report in openerp. that ways is, I created sxw and convet into rml then rml into pdf. It is working fine now. What my doubts is, when try to get date and time field value, it's getting only date. Time is not coming in pdf report.
Field name in python: 'sample_receipt_date':datetime(....)
in sxw: [[formatLang(o.sample_receipt_date,date=True)]]
After convert pdf: dd/mm/yy
but i want this format dd/mm/yy/min/sec in pdf.
what is python coding in sxw document?
[[ time.ctime() ]] should work in RML, otherwise, take a look at https://doc.openerp.com/6.1/vi/developer/05_reports/ or the full RML for Idiots manual
Try this:
replace (date=True) By (date_time=True)