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
Solved

Function to format date part of variable

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

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

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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

860 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