Solved

concatenate a date field

Posted on 2012-03-28
2
559 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can I add a checkbox function/control button in Crystal Reports ? 4 82
Conditional Text in Crystal 4 59
Exclude some records from totals 10 63
Sum not calculating correctly 22 47
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…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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