Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Date Parameter Formatting Post Reply Post New Topic
Author Message
little wing
Newbie
Newbie
Avatar

Joined: 12 Dec 2011
Online Status: Offline
Posts: 13
Quote little wing Replybullet Topic: Date Parameter Formatting
     Posted: 09 Feb 2012 at 9:52am
Hey everyone,

Here is my deal:

I'm unable to input dates as a parameter in any format other than yyyy-mm-dd.

My company uses a CR viewer that only allows users to input dates in mm-dd-yyyy format.

So for a workaround, I've changed the date parameter to a string parameter and am attempting to then edit that string into a date for my selection criteria.

The problem I'm running into is this error when trying to input the formula:

Error:
"Too many arguments have been given to this function."

Formula:
CDate ((right({?TestStartDateString}, 4)) , (left({?TestStartDateString}, 2)) , (mid({?TestStartDateString}, 4, 2)))


Is there a better function to use, or maybe just a small error I am making? All I'm trying to do at this point is drop these values (mm, dd, yyyy) into a date variable, then I should be able to figure out the rest. Much appreciation for your time!


Edited by little wing - 09 Feb 2012 at 10:01am
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 09 Feb 2012 at 12:19pm
try this
date(right({?My Parameter},4)+","+left({?My Parameter},2)+","+mid({?My Parameter},4,2))
IP IP Logged
little wing
Newbie
Newbie
Avatar

Joined: 12 Dec 2011
Online Status: Offline
Posts: 13
Quote little wing Replybullet Posted: 10 Feb 2012 at 2:06am
This did the trick, Thank you KostYa! I had tried it with a - instead of a , but had no luck, funny this would work. Much appreciated! Clap
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