Crystal reports format number

I have the following problem when the value is returned to the screen the number show like 2,009 how do I rid of the comma? Is there a format function?

Dim MonthInt as number
Dim MonthString as String
Dim yearString as Number
MonthInt = Month({StaffProjVar;1.Begin date})

MonthInt = (MonthInt + 11)

If (Monthint) <= 12 then
    MonthString = MonthName(MonthInt)
Else
    MonthInt = MonthInt - 12
    MonthString = MonthName(MonthInt)
    YearString = (Year({StaffProjVar;1.Begin date}) + 1)
End If  

Formula = (MonthString + " " + (Cstr(YearString)))
MittensonmauiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
You can format your object by right-clicking on it, select Format Object, and from the Number tab, select the format without the comma -1123
0
MittensonmauiAuthor Commented:
Unfortunately the Formula is returning a string so the number tab is not an option.
I need to fromat it before it is returned.
0
Éric MoreauSenior .Net ConsultantCommented:
have you tried:
Formula = (MonthString + " " + replace(Cstr(YearString),',',''))
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

MittensonmauiAuthor Commented:
Still didn't work, It seems as though the field is being converted to currency on tyhe yeild function this is CR 2008 maybe it is a bug?
0
mlmccCommented:
You can use the CStr to not insert the ,

CStr(YearString),0,'')

mlmcc
0
wykabryanCommented:
mlmcc's solution will work or you can do a totext(YearString,'0')
0
bdreed35Commented:
Mittensonmaui:

You can streamline this formula to one line and get the result you want like this:

formula = cstr(dateadd("m",11,{StaffProjVar;1.Begin date}),"MMMM yyyy")

There is no need to break things down into months and years.  You can just add 11 months to the date, then format it MonthName and Year using the CStr function
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MittensonmauiAuthor Commented:
Great thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.