How to apply Date format to the Imported Range - date

I have a question, how to apply date format to the results comming from query(Importrange) formula.
My formula "=filter({A:A,row(A:A)},isnumber(A:A))" in B1 can't see these dates. Spreadsheet only can see this as a text, not number.
Spreadsheet with example.
Do you have any ideas?

use:
=FILTER({A:A, ROW(A:A)}, ISNUMBER(A:A*1))

Related

In snowflake , how to convert one date format to another format. From YYYYMMDD to YYYY-MON-DD

I have table ABC in which I have column Z of datatype Date. The format of the data is YYYYMMDD. Now I am looking to convert the above format to YYYY-MON-DD format. Can someone help?
You can use to_char
TO_CHAR(Z,'YYYY-MON-DD')
Depending on what the purpose of the reformatting is, you can either explicitly cast it to a VARCHAR/CHAR and define the format, or you can change your display format to however you'd like to see all dates:
ALTER SESSION SET DATE_OUTPUT_FORMAT = 'YYYY-MON-DD';
It's important to understand that if the data is in a DATE field, then it is stored as a date, and the format of the date is dependent on your viewing preferences, not how it is stored.
Since the value of the date field is stored as a number, you have to convert it to date.
ALTER SESSION SET DATE_OUTPUT_FORMAT = 'YYYY-MON-DD';
select to_date(to_char( z ), 'YYYYMMDD');
(adding this answer to summarize and resolve the question - since the clues and answers are scattered through comments)
The question stated that column Z is of type DATE, but it really seems to be a NUMBER.
Then before parsing a number like 20201017 to a date, first you need to transform it to a STRING.
Once the original number is parsed to a date, it can be represented as a new string formatted as desired.
WITH data AS (
SELECT 20201017 AS z
)
SELECT TO_CHAR(TO_DATE(TO_CHAR(z), 'YYYYMMDD'), 'YYYY-MON-DD')
FROM data;
# 2020-Oct-17

Date format in SSRS Expression

I am trying to change the date format for one of my field to dd/MM/yyyy but every time I used the below expression I get dd/MM/yyyy as the value in the cell instead of changing the format.
The data source that I am using is Teradata.
Expression used: =Format(FormatDateTime(Fields!DATE.Value, DateFormat.ShortDate),"dd/MM/yyyy")
Can some one help me with where am I going wrong.
Any help would be appreciated.
The FormatDateTime function returns a string instead of a date. When the FORMAT function tries to format it, it doesn't find a date field so it returns the characters in the format.
If your field is a date, you should be able to format the field without conversion:
=Format(Fields!DATE.Value,"dd/MM/yyyy")
If it does need to be converted first, try using the CDATE function:
=Format(CDATE(Fields!DATE.Value),"dd/MM/yyyy")

Convert yyyymmdd to date for record selection

I'm a Crystal newbie with limited experience at SQL commands.
Here's my problem.
My database stores dates in the yyyymmdd numeric format. I created a Date Range parameter field to allow the user to select a date range. When I try to add the {?Date Range} to the record selection I get an error message that says "A number range is required here", apparently because my {?Date Range} field is looking for a date and not a number. I believe what I have to do is convert my dates to a date format, but I don't know how to do that.
Could someone please tell me how to make this work?
Much appreciation, thanks
I don't have Crystal around to check the syntax , but generally you need to convert the daterange to numeric values and use theese values in your record selection formula
the TO value will be
tonumber(totext(Maximum({?ParameterDateRange}),'yyyyMMdd'))
the FROM value will be
tonumber(totext(Minimum ({?ParameterDateRange}),'yyyyMMdd'))
so the formula might be something like
{YourField} IN tonumber(totext(Minimum ({?DateRange}),'yyyyMMdd')) TO tonumber(totext(Maximum({?DateRange}),'yyyyMMdd'))
You can also use < and > instead of between
you can use CDate fucntion to convert numeric to Date.
CDate(ToNumber(Mid(ToText(20141231),1,4)),ToNumber(Mid(ToText(20141231),5,2)),ToNumber(Mid(ToText(20141231),7,2)))
Check the link for documentation
http://www-01.ibm.com/support/knowledgecenter/SS4JCV_7.5.5/com.businessobjects.integration.eclipse.designer.doc/html/topic728.html
Try:
{table.date} IN ToText(Minimum({?DateRange}),"yyyymmdd") TO ToText(Maximum({?DateRange}),"yyyymmdd")

Convert Date Value When Using Google Form Date Picker from 5 Digit Format to MM/dd/yyyy format

I selected tomorrow's date (8/21/2014) from the data picker field of a Google Form submission, and the value "41872" is returned in the spreadsheet.
What format is this date format?
I need to convert this date format to the MM/dd/yyyy format using script, as formatting the Date column using the Format menu only updates the rows that are currently available...not the new rows that will be there when new form submissions come in.
How do I make this conversion?
I am not sure, but your issue seems to be very basic. Its about the cell formatting as like we do in Ms Excel.
For Google spreadsheet inorder to format a cell or a range,
1. Select the Range
2. On menu, Go To Format->Number->Date (and then select the required format)
Does this works?
I had the same confusion. All you need to do is just change the format from the menu Format->Number->Date & Time

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.