Solved

Function to format date part of variable

Posted on 2006-07-13
4
1,145 Views
Last Modified: 2007-11-27
I have a formula field that displays the date range based on two other date formula fields. The formula is:
{@StartDate} & " through " & {@StopDate}

The problem is, it displays as (example):
7/12/2006 08:12:34 through 8/11/2006 08:12:34

I want it to display as:
7/12/2006 through 8/11/2006

Other than using DatePart to pull each of the parts of the date and concatenating them back together, is there another function I can use?
0
Comment
Question by:dbbishop
  • 2
4 Comments
 
LVL 42

Accepted Solution

by:
frodoman earned 300 total points
ID: 17102101
CStr({@StartDate},'MM/dd/yyyy') + ' through ' + CStr({@StopDate},'MM/dd/yyyy')

Make sure you use upper case M or you'll get 'minutes' instead of 'months'
0
 
LVL 28

Assisted Solution

by:bdreed35
bdreed35 earned 200 total points
ID: 17103046
I would just add that if you only want a single digit month value or day value then you can alter it this way:

CStr({@StartDate},'M/d/yyyy') + ' through ' + CStr({@StopDate},'M/d/yyyy')

I am just going based upon your example data that you posted
0
 
LVL 15

Author Comment

by:dbbishop
ID: 17104857
Thanks to both of you. For some reason, when I hit F1 in in the Formula Workshop I get an error telling me Help is not installed. I've looked through the noprmal Crystal help and the Developer's help manual and could find nothing that would help me (I am used to using Format in VB)
0
 
LVL 42

Expert Comment

by:frodoman
ID: 17107747
You might want to try a reinstall to get your help files - they're actually worthwhile in Crystal and there is a topic that fully explains all of the date format options.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
IF THEN Statement not working 3 27
Query Builder on BOXIR2 7 48
Select Cross-tab total 2 43
Business Object Server 2 22
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…
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 …
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

20 Experts available now in Live!

Get 1:1 Help Now