OK, here is something that is me missing the obvious.
I have an Excel spreadsheet consisting of 2 columns and 5 rows. The first column is formatted in Excel as a dd-mmm-yy date. The second column is a string.
I import the file into Mathematica:
testData = Flatten[Import["testData.xlsx","Data"],1]
I want to use Cases to select the rows that belong to September 3:
myDate = DateObject[{2017,9,3,0,0,0}]
Cases[testData,{myDate,_}]
but this gives as output:
{}
What am I missing? Thanks much in advance.
DateObject
probably has a lot of meta-info tagged onto it. Extract one of them and look at itsFullForm
and use the pattern you derive from that for youmyDate
. My guess is you'll want to do something likeDateObject[{2017, 9, 3, ___}, ___]
$\endgroup$myDate
probably captured some of that. I dunno if it would have captured all, though. Did this pattern work:DateObject[{2017, 9, 3, ___}, ___]
? $\endgroup$