Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9713

Why doesn't "format A 'yyyy-mm' options no_values" strip the day from the output?

$
0
0

I have some input that contains a set of dates. I want to strip the day from the input and sort by just the month and year. I know there are other ways to do this, but why can't I set the format to yyyy-mm and then specify options no_values to ensure that the output does not include the day, at all (documentation reference)?

Example data is below. Notably, the output is sorted by day, which I do not want. I only want the output to be sorted by month. Note that this example contains only one month for simplicity.

input:

DateVal1
8/5/201510
8/27/201513
8/14/20154

formula:=query(A2:B,"select A,B where A is not null order by A asc format A 'yyyy-mm' options no_values",0)

output (when looking at cells):

Col1Col2
2015-0810
2015-084
2015-0813

output (when looking at formula bar):

Col1Col2
2015-08-0510
2015-08-144
2015-08-2713

Viewing all articles
Browse latest Browse all 9713

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>