Solved

concatenate a date field

Posted on 2012-03-28
2
554 Views
Last Modified: 2012-06-27
Hi, I'm making a crystal report and used a parameter:  date,  "10/23/2010".  I'd like to create a single numeric field from a formula like "201010".  When I create the date "10/23/2010" as Year 2010 (number) then Month 10 (number) then try to concatenate the two I get a string value with comma and decimal like 2,010.00 then I can not format the field, same for the month 10.00 they both show up as string values.

Is there a way to do this as 201010?  I need to do some calculation and compare on these fields once created as formulat.  What  do I need to  use?   I tried Concatenate (&, +""+,Var,Cstr,etc.)  Is there anyway to do this?  Thanks in advance.
0
Comment
Question by:Renshi04
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 37777502
Create a formula field...

totext({table.datefieldname}, "yyyyMM")
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 37777593
That should work.

Using your method you would want to use

CStr(Year({Datefield},0,'') & CStr(Month({DateField},0)

The 0 means 0 - decimal places and the '' is the thousands separator - in this case none

mlmcc
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

12 Experts available now in Live!

Get 1:1 Help Now