Solved

concatenate a date field part 2 Got a message "Bad Number format String"

Posted on 2012-03-28
7
420 Views
Last Modified: 2012-05-10
Thanks for the solution to ID 27652324 but now I want to use those results to create a formula that will subtact one year from the '201010'  to  '200910'.  I used a formula called "last year"  "Year ({?Selected_Date}) - 1"  got 2009, great  then tried to build  formula "totext({@Last year}, "yyyy")&ToText ({?Selected_Date}, "MM")  to build the '200910' but I got Bad Number format".  I am trying to use the parameter input date (10/23/2010) keyed in by the user to
select and compare employment counts in 2010 verus the same period 2009.

Can you point me in the right direction, again?  Thank you in advance.
0
Comment
Question by:Renshi04
  • 2
  • 2
7 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 37778782
WHat do you mean by period?

WHat formula is giving the error?

mlmcc
0
 
LVL 34

Accepted Solution

by:
James0628 earned 500 total points
ID: 37780486
The problem is that in totext({@Last year}, "yyyy"), the "yyyy" format is to output the year from a date/datetime, but your {@Last year} formula is just a number (the year from {?Selected_Date}).  It's the same as saying ToText (2009, "yyyy"), and since 2009 is just a number, and "yyyy" is a date/datetime format, you get the "bad number format" error.

 You could fix this by changing the second formula to:

ToText ({@Last year}, "#") & ToText ({?Selected_Date}, "MM")

 The "#" format string is just a shorthand way of saying "no thousands separator and no decimal places").

 Or, for a slightly more direct solution, you could forget the {@Last year} formula and just subtract 1 from the year in that formula:

ToText (Year ({?Selected_Date}) - 1, "#") & ToText ({?Selected_Date}, "MM")


 James
0
 

Author Comment

by:Renshi04
ID: 37837557
Thanks, the user ask the wrong question.
0
 
LVL 34

Expert Comment

by:James0628
ID: 37841310
FWIW, I don't see how mlmcc's post is the solution to your question.  I think I did answer your question, but if the question was "wrong" somewhow, maybe you should just ask to have it deleted.

 James
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 37843366
Agree.  James seems to have answered the question that was asked.  If you haven't tried the solution you should.

Since the answer selected is obbviously not the solution I have unaccepted the comment.

mlmcc
Zone Advisor
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now