?
Solved

Function to format date part of variable

Posted on 2006-07-13
4
Medium Priority
?
1,150 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 1200 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 800 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

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…
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 …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

777 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