Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Compare Instr to Current Date Post Reply Post New Topic
Author Message
Rosie111
Newbie
Newbie
Avatar

Joined: 09 May 2011
Location: United States
Online Status: Offline
Posts: 1
Quote Rosie111 Replybullet Topic: Compare Instr to Current Date
    Posted: 09 May 2011 at 9:20am
Hi,
I am very, very new to Crystal Reports and got a hard one right away (I think anyway).
 
I need to filter a report based on a field in Excel that holds data such as:
"Jan, Mar, Apr, Nov, Dec" which needs to match the current month.  So, if today is in May and May is somewhere in the field ({Joblog_.FREQUENCY DETAIL} then I want that record.  That is the hard part for me. 
 
Also in the filter (The easier part) is that
{Joblog_.FREQUENCY DETAIL} could also be empty and
{Joblog_.FREQUENCY} has to be "Monthly" and last,
{Joblog_.DUE DATE} has to equal 1.00.
 
FREQUENCY DETAIL is a text field in Excel.
This is what I have tried and do not get the correct results.  I'm sure it has to do with the date part and instr, as I do not know the correct way to write it.

Local StringVar mnth := totext(CurrentDate,"mmm");

{Joblog_.FREQUENCY} = "MONTHLY" and

{Joblog_.DUE DATE} = 1.00 and

isnull({Joblog_.FREQUENCY DETAIL}) OR

{Joblog_.FREQUENCY} = "MONTHLY" and

{Joblog_.DUE DATE} = 1.00 and

INSTR({Joblog_.FREQUENCY DETAIL}, mnth) = 1

Like I said, I am very new with Crystal and do not know the correct syntax for the instr or the date function.  Can someone please help!
Thank you.
 
Lisa
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 18 May 2011 at 3:36am
probably you want the instr to be > 0...it is in the string.  it's probably 1.  The other consideration would be casing...
 
but here is the big issue...toText should use "MMM" which is month "mmm" is minutes.
 
Hope this isn't too late
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.031 seconds.