Solved

Function to format date part of variable

Posted on 2006-07-13
4
1,149 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
[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
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

724 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