Date cleaning in excel,date values align to the left - r

I have excel file a date column, some of date are align to the right while others to the left.when i read the into r am getting this error.
Expecting date in A3547 / R3547C1: got '13/04/2018'
on dates align to the left. I have tried to clean the date in excel with no success,

You can do something similar to this
I have extracted the day, month and year from the string date using
some formulas
After that I have recreated the actual date from the
extracted day, month and year values
Formulas are as below
B2: =FIND("/",A2)
C2: =FIND("/",A2,1+FIND("/",A2))
D2: =LEFT(A2,B2-1)
E2: =MID(A2,B2+1,C2-B2-1)
F2: =RIGHT(A2,4)
G2: =DATE(F2,E2,D2)
Depending upon your actual data you may need to amend the formulas a little bit.

Please check whether all the cells in the column has date format and same date format.
Sometimes dates can be enter as text strings or other custom formats. Then there is a possibility to getting error like this.

This is how the data looks like in excel, both date and text
Load the same in MS Excel Power Query Editor, select the date column, Under the Transform Tab select "Split Column, By Delimiter", select "/" as the delimiter and Click OK. This separated the date into Month, Day and Year+Time.
Highlight the Day Column first, then Month, then Year+Time ...in that order, and then click "Merge Columns" under the Transform Tab.
Highlight the now Merged column and under "Data Type", select "Date/Time". You can now go back to the Home tab and Select Close & Load to get the cleaned data into Excel... as below;

Related

Google Sheets: Date and time is seen as a text and cannot be coerced to a number

I'm trying to format dates given to me in an excel spreadsheet, and some of the values are seen as a text. I've tried using the format option to set a date and time to the entire column.
The Sheet
Try
={""; ARRAYFORMULA(iferror(IF(A2:A="",,DATE(YEAR(E2:E), MONTH(E2:E), 1)),date("20" & REGEXEXTRACT(E2:E,".*\/(\d{2}) "),REGEXEXTRACT(E2:E,"\d+"),1)))}
Reference
REGEXEXTRACT

How to force DateTime field in Quicksight on string column?

I have a data set that has dates like so:
datetimecreated
2019-09-14 06:06:15.863383
2019-09-14 06:06:16.863385
When I go to edit my data set and force column datetimecreated into datatype date time, I get error:
Known date formats were not detected in this data. Provide a date format to transform this data into a known date format.
The data format I am trying to pass is this:
yyyy-MM-dd HH:mm:ss.ffffff
What am I doing wrong that this can not be detected as date field by Quicksight?
I've even tried this format:
yyyy-MM-dd HH:mm:ss
get same error as above.
First check would be if the date format is accepted in quicksight:
Quicksight User Guide pg.71
I don't think "yyyy-MM-dd HH:mm:ss:SSSSSS" is an accepted format.
In which case you may want to just extract the datetime data from the string to the most relevant format so that is usable for your analysis.
To do so you can create a calculated field based on your "datetimecreated" field using the parseDate() function:
parseDate(date, [format], [time_zone])
It's possible to create a calculated field either in the "Edit Data" section of the dataset by selecting it the dropdown menu for the "datetimecreated" field in the field list OR by selecting the option in the "Add" menu within a specific analysis.
Inserting your data into the formula would look something like this:
parseDate({datetimecreated}, yyyy-MM-dd HH:mm:ss, [time_zone])
This should create a date field with the extracted date information that you can then manipulate as with any other date and aggregate by DAY, MONTH etc.
I had this issue, I used this page for that correct formats:
https://docs.aws.amazon.com/quicksight/latest/user/parseDate-function.html
The format I required was yyyy-MM-dd'T'HH:mm:ssZ
Correct format is yyyy-MM-dd HH:mm:ss:SSSSSS

PHPExcel how to set date format in cell during export so filtration is available?

I would like to be able to filter my data like this:
Year ( + )
Month ( + )
Day ( + ).
At first i tought it's problem of cell formatting cause the format was set to General. So i did this:
$objPHPExcel->getActiveSheet()
->getStyle('G2:G256')
->getNumberFormat()
->setFormatCode(
PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD2
);
And i worked. Now my cell G2 is formatted as date (at least excel says so). But i'm not able to sort this until i select cell and hit enter, after this ONLY this one cell is sortable. I have no idea why.
Thanks in advance for any help!
You need to set date values in cells as MS Excel timestamp values, not strings or unix timestamps.
Assuming from the way you're doing it at the moment that $row->user_created is a Unix timestamp value the, rather than
$formattedRow[] = date('Y-m-d',$row->user_created);
use
$formattedRow[] = PHPExcel_Shared_Date::PHPToExcel(
$row->user_created
);
which will set the value to a MS Excel serialized date/timestamp
You still want to set the number format mask, so that MS Excel knows how the date should be displayed; but as it's stored in Excel format rather than as a string, it will be sortable or filterable, or usable in formulae, etc

Can I filter Google Sheets results by date and time relevent to current time?

I have a spreadsheet where sheet1 contains 1 text field of data and a date and time assigned to the data. On sheet 2 I need to have a filter that searches for an element in the text (using "=filter(sheet1!A1:A, search("search phrase", sheet1!A1:A))" to filter that part) but need to show only results where the time associated is for between 18hours - 3days before the current date and time. There is only one column of data other than the date and time, date and time is currently shown as "Date: 24.03.2013 11:04"
I managed to create these formulas
=filter(Sheet1!A1:C, Sheet1!C1:C>minus(now(),3), Sheet1!C1:C<minus(now(),"12:00:00"))
=filter(importrange("Key","Sheet1!A1:C"), importrange("Key","Sheet1!C1:C")>minus(now(),3), importrange("Key","Sheet1!C1:C")<minus(now(),"12:00:00"))

SQL Developer: Load Data Date error

I am using Oracle SQL Developer 3.0.03. I am trying to upload an Excel file to an Oracle data table. I am getting an error for the date. The column in the database is a timestamp and I don't know what to put into the date format for the 'Data Load Wizard'. If I use the following format (dd-mom-yy hh.mi.ss), SQL Developer will show the following error:
--Insert failed for row 1 TIMESTAMP_COLUMN GDK-05047: A day of the month must be between 1 and the last day of the month.
--Row 1
INSERT INTO TABLE_1 (Column1, Column2, Column3, TIMESTAMP_COLUMN) VALUES ('Some Text','Some Text','Some more text',to_timestamp('40604.0', 'dd-mon-yy hh.mi.ss'));
The default number format IN EXCEL is: 40604.0
Which if you change the cell to a short date format you will get: 3/2/2011
I am trying to figure out what 'Format' I need to put into the FORMAT section of the 'DATA Load Wizard' that will accept the date format that is in EXCEL and upload it to Oracle as a TIMESTAMP.
I ran into the same thing today, and 'fixed' this two ways. The second way probably seems too complex, but it might help someone if they have a hard time automating the formatting of dates to look like Oracle's standard dd-mmm-yy.
Format the date columns in Excel as dd-mmm-yy and import directly into the table.
Highlight the column(s)
Choose "More Number Formats" where the existing format is (In Excel 2010, it says General in a dropbox on the Home tab
Select the last entry "Custom" in the Category box
Manually enter dd-mmm-yy in the Type: box
Format the date columns in Excel as mm/dd/yy, import the table in as text, write a manual insert statement from the temp text table using TO_DATE(date_field,'MM/DD/YYYY')
Highlight the column(s)
Choose "More Number Formats" where the existing format is (In Excel 2010, it says General in a dropbox on the Home tab
Select the "Date" entry in the Category box
Choose "03/14/01" from the list
The Excel "zero" date is January 0 (yes, zero), 1900. Since Oracle can't handle a "zero" day in a month you need to subtract 1 from the Excel value; thus the following should get you close to what you want:
SELECT CAST(TO_DATE('01-JAN-1900 00:00:00', 'DD-MON-YYYY HH24:MI:SS') AS TIMESTAMP) +
NUMTODSINTERVAL(41017.6361109954 - 1, 'DAY')
FROM DUAL
As far as "how to import it" goes, there's no Oracle date format that I'm aware of to do this. The easiest thing would be to import the value into a NUMBER column and then run a script to do the date conversion.
Share and enjoy.
yeah and that's the problem.
"A day of the month must be between 1 and the last day of the month."
1) how are these decimals created?
2) is this "04-06-2004" ? or are these seconds from 1970?
you need to add more detail about this number format!

Resources