"A date-time is required here."

Jeff S
Jeff S used Ask the Experts™
on
I am getting the following message on my formula: "A date-time is required here."

{data.MonthYear} <> '01/01/1900'

I am trying to create a formula to exclude transactions with a MonthYear = 01/01/1900 in a side by side bar chart. Any help is appreciated.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Try it this way

Date({data.MonthYear}) <>Date(1900,1,1)

or

{data.MonthYear} <>Date(1900,1,1)

mlmcc
Or,

{data.MonthYear} <> #01/01/1900#


 CR uses quotes for string literals, so with '01/01/1900', you're trying to compare MonthYear, which is apparently datetime, with a string.  CR doesn't do implicit conversions between string and date/datetime.

 CR uses # for datetime literals.

 James

Author

Commented:
Thank you
You're welcome.  Glad I could help.

 James
FWIW, from what you posted in another question, it seems that you used one of mlmcc's suggestions.  If so, you should have given him some, if not most, of the points.  I didn't say anything earlier, because while his suggestions were valid, I thought that my post better addressed your specific situation and the error, so I let it go.  But if you actually used his suggestion, I think he should definitely get some of the points (not to mention his post being included in the "solution", for possible future reference by others).

 If you like, you can use the "Request Attention" link to ask to have the question re-opened, and then split the points however you see fit.

 James

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial