How do I pull the week of the month from text strings in this Twilio format 2019-08-22 06:12:58 MDT? - date

I am using the Twilio log file to crunch some data and need to convert the Twilio format for dates into something that Google Sheets can recognize as a date so I can then extract what week of the month the date is referring to. Also would be helpful to get the syntax that converts the Twilio date to a recognizable date for Googlesheets in case there are other things I need to do with the date field.
Currently, this is the format in the log file: "2019-08-22 06:12:58 MDT"
I'm using this =text(index(split(I2," "),,1),"mmmm") to determine the month and am struggling to have this now be able to work with the WEEKNUM function of Googlesheets to get the number of the week the date is from. I've tried =DATE(index(split(I2," "),,1),"mmmm"), =WEEKNUM(index(split(I2," "),,1),"mmmm") but am terrible with the formula syntax and can't fix the date value.
=DATE(index(split(I2," "),,1),"mmmm")
I expect to see a value from 1-5.

The text() part of the formula is turning the date input into text. And so you can't use it to calculate the weeknum().
=weeknum(index(split(I2," "),,1)) will get you closer. But it will give you the week of the year.
You may want to see this for a way to get to week of the month from week in the year.

Related

How to get last day of previous month in DataStage?

I explored all the functions available in the transformer, but I couldn't find the exact function to get the last day of the previous month in standard format, i.e. dd/mm/yyyy. Please help me in this regard.
The field that needs to appear is in the COL_C field.
enter image description here
inside it I can't put anything that returns me this result
You can use DateOffsetByComponents to substract the current day.
Cut out the day part from your date and substract it with above function.
i.e. 16/12/2022 - 16 = 30/11/2022

MS Access: Show string in the date field when empty

I'm looking to have my field show "dd-mmm-yy" when a date is not entered into the field, so members don't get confused and frustrated when they try to put in a date such as 11/12/20 and don't realize it needs to be in day day, month month month, year year format. Is this possible to do through the property sheet?
[date format]
You can set the Format property of the textbox to:
dd-mm-yyyy;;;"dd-mm-yyyy"
though I believe it will add more confusion than help.
Another method for speedy input of dates is shown in my article:
Entering ISO formatted date with input mask and full validation in Microsoft Access

Tableau is reading my dates wrong

Tableau is reading my dates wrong. I have 2 columns, Date and number for each day.
The date format is “yyyymmdd” i.e. (20160617) and per day number is integer. I am fetching this data directly from SQL server and my problem is, tableau is reading my dates wrong.
So I tried DATEPARSE() to convert my date.
My DATEPARSE function is : DATEPARSE(“yyyymmdd”,”Date”) , now after using DATEPARSE function, I get NULL for my dates.
Can anyone please help me why I get NULL for dates, my query returns 30-day data which is divided into per day count.
Sample after running the query on SQL
Date Per day number
20160617 215674
Tableau does not accept this date format and I applied DateParse(), which I guess is returning string since my date is null. I would ideally like to get the correct date so I can apply a trend line on my data.
Thanks in advance.
Cheers!
You aren't using DateParse() correctly. The second parameter, which you have as "Date", should be the name of the field you want parsed. So for example, if you store 20160617 in a field called my_date_as_integer, your function should be DateParse("yyyymmdd", [my_date_as_integer])

Number of days between past date and current date in Google spreadsheet

I want to calculate the number of days passed between past date and a current date. My past date is in the format dd/mm/yyyy format. I have used below mentioned formulas but giving the proper output.
=DAYS360(A2,TODAY())
=MINUS(D2,TODAY())
In the above formula A2 = 4/12/2012 (dd/mm/yyyy) and I am not sure whether TODAY returns in dd/mm/yyyy format or not. I have tried using 123 button on the tool bar, but no luck.
The following seemed to work well for me:
=DATEDIF(B2, Today(), "D")
DAYS360 does not calculate what you want, i.e. the number of days passed between the two dates – see the end of this post for details.
MINUS() should work fine, just not how you tried but the other way round:
=MINUS(TODAY(),D2)
You may also use simple subtraction (-):
=TODAY()-D2
I made an updated copy of #DrCord’s sample spreadsheet to illustrate this.
Are you SURE you want DAYS360? That is a specialized function used in the
financial sector to simplify calculations for bonds. It assumes a 360 day
year, with 12 months of 30 days each. If you really want actual days, you'll
lose 6 days each year.
[source]
Since this is the top Google answer for this, and it was way easier than I expected, here is the simple answer. Just subtract date1 from date2.
If this is your spreadsheet dates
A B
1 10/11/2017 12/1/2017
=(B1)-(A1)
results in 51, which is the number of days between a past date and a current date in Google spreadsheet
As long as it is a date format Google Sheets recognizes, you can directly subtract them and it will be correct.
To do it for a current date, just use the =TODAY() function.
=TODAY()-A1
While today works great, you can't use a date directly in the formula, you should referencing a cell that contains a date.
=(12/1/2017)-(10/1/2017) results in 0.0009915716411, not 61.
I used your idea, and found the difference and then just divided by 365 days. Worked a treat.
=MINUS(F2,TODAY())/365
Then I shifted my cell properties to not display decimals.
If you are using the two formulas at the same time, it will not work...
Here is a simple spreadsheet with it working:
https://docs.google.com/spreadsheet/ccc?key=0AiOy0YDBXjt4dDJSQWg1Qlp6TEw5SzNqZENGOWgwbGc
If you are still getting problems I would need to know what type of erroneous result you are getting.
Today() returns a numeric integer value: Returns the current computer system date. The value is updated when your document recalculates. TODAY is a function without arguments.
The following worked for me. Kindly note that TODAY() must NOT be the first argument in the function otherwise it will not work.
=DATEDIF( W2, TODAY(), "d")
Today() does return value in DATE format.
Select your "Days left field" and paste this formula in the field
=DAYS360(today(),C2)
Go to Format > Number > More formats >Custom number format and select the number with no decimal numbers.
I tested, it works, at least in new version of Sheets, March 2015.

Retrieve "July 10" and "Last Tues" from SQLite Date field in iPhone

I have this date in my history table with field dtEnd="2012-07-10 11:07:00"
and i want to retrieve July 10 and Last Tues both from this date separately.
Can anybody suggest a query for doing this?
Thanks.
While surfing, I came to know that it is not possible to get Month and date name instead you have to use your logic for that.
I got the solution, I am getting month and date with:
Select strftime('%m-%d','dtend')'Date' from history
And then I am extracting month and day number separately and then passing that month number to my own function with switch case to give month name.
That's it and I got my solution.