Solved

concatenate a date field

Posted on 2012-03-28
2
555 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 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

25 Experts available now in Live!

Get 1:1 Help Now