Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Date Range Post Reply Post New Topic
Author Message
aguarino87
Newbie
Newbie


Joined: 01 May 2008
Location: United States
Online Status: Offline
Posts: 5
Quote aguarino87 Replybullet Topic: Date Range
    Posted: 30 May 2008 at 6:42am
Hello, all:
 
I have posted once before, I am completely new to Crystal and trying to figure things out as I go. my next task is a date range. I created a report and I copied a date range formula from an existing report (cheating, I know). I had to set my date parameters as strings to get the formula to work, because of the way AccPac (the program I need to talk to Crystal) stores dates (yyyymmdd). So, on my report the date shows up as yyyymmdd. It's probably not a HUGE deal, but I'd like to corret it. If I change the field I'm using with pwformatdate, then my date range formula doesn't work. To, I'm looking for a date range formula that will allow the user to pick a start date and and end date using the clickable calendar. My current formula is:
 
{VMPH.DTPOSTED} in tonumber ({?Date_From}) to tonumber ({?Date_To})
 
Any help would be greatly appreciated.
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 30 May 2008 at 11:37am
You can use something like the following formula to convert the date to the format you want. I wrote this to do the opposite of what you want, that is it takes a date like '20050508' and converts it to a string '05'08/2005'
 
Still it should be easy enough for you to convert to what you need.
-------------------------------------------------
 
Stringvar varDateMonth;
Stringvar varDateDay;
Stringvar varDateyear;
Stringvar varNewDate;

If {CTR_Detail.trans date} <> "" then
varDateMonth := Mid({CTR_Detail.trans date},5,2);
varDateDay :=Mid({CTR_Detail.trans date},7,2);
vardateYear := Mid({CTR_Detail.trans date},1,4);
varNewDate := varDateMonth + "/" + varDateDay +"/" + varDateYear;
varNewDate;
 
------------------------------------------
 
Hope it helps
 
John W.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.035 seconds.