Solved

concatenate a date field

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

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

707 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