Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Format a date parameter from yyyy-mm-dd to mm-dd-y Post Reply Post New Topic
Author Message
dawnh44
Groupie
Groupie


Joined: 25 Sep 2011
Online Status: Offline
Posts: 79
Quote dawnh44 Replybullet Topic: Format a date parameter from yyyy-mm-dd to mm-dd-y
     Posted: 10 Feb 2012 at 4:58am
Hello everyone,
 
I have a date parameter that is pulled from a stored procedure in the format yyyy-mm-dd, but I need the format to be mm-dd-yyyy.  Can you please help?
 
Thank you in advance.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 10 Feb 2012 at 5:38am
try going to format editor (right click on field)
date and time custom options  date tab under Order click on "MDY"
a formula like
date(mid(datefield,4,2)+"-"+right(datefield,2)+"-"+left(datefield,4))
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Feb 2012 at 11:47am
is it a datefield or a string? is it being passed to the sp or returned from?
 
if it is being returned, can it be changed in the proc?  if it is being returned as a string, you will probably have to do was kostya1122 says.  If it is being dealt with as a datetime field you can just format it however you want.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum