Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula & Report Assistant Needed Post Reply Post New Topic
Author Message
didar.sust
Newbie
Newbie
Avatar

Joined: 02 Jan 2012
Location: Bangladesh
Online Status: Offline
Posts: 3
Quote didar.sust Replybullet Topic: Formula & Report Assistant Needed
     Posted: 02 Jan 2012 at 7:03pm
[FONT=Tahoma]

Hi,

I am novice in crystal reporting. I have a MSSQL 2008 database in backend and i can generate simple reports. but when any function/user supplied parameter are in operation, i failed to generate any report. would appreciate anyone feedback in earliest convenience.

sample report is attached here. I want to select values which are
"External"
"Inbound" &
12/24/2011 10:00:00 AM to 12/24/2011 04:00:00 PM
http://www.sendspace.com/file/pwkpcb

Regards.

Edited by didar.sust - 02 Jan 2012 at 7:36pm
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Jan 2012 at 4:39am
one would think it would be something like:
 
{table.field1} = "External" and {table.field2} in cdatetime(2011,12,24, 10,0,0) to cdate(2011,12,24,16,0,0)
 
HTH
IP IP Logged
didar.sust
Newbie
Newbie
Avatar

Joined: 02 Jan 2012
Location: Bangladesh
Online Status: Offline
Posts: 3
Quote didar.sust Replybullet Posted: 03 Jan 2012 at 9:42pm
Hi,

Thanks for your reply. I'm a bit confused where should to put this expression.

In Formula Fields I have created two fields named 1. CallDirection 2. CallType

and from selection expert below formula is added:

{@CallType}="External" and
{@CallDirection}="Inbound"

DateTime field will be supplied by the user when (s)he generates the report. Now i'm stuck in here which fields should i put in the report and how Id will be selected based on DateTime.

Thanks.
IP IP Logged
didar.sust
Newbie
Newbie
Avatar

Joined: 02 Jan 2012
Location: Bangladesh
Online Status: Offline
Posts: 3
Quote didar.sust Replybullet Posted: 03 Jan 2012 at 9:53pm
have added a Parameter DateTime (StringType). and set the below formula in selection Expert

{@CallType}="External" and
{@CallDirection}="Inbound" and
(@DateTime) in {?DateTime} to {?DateTime}

while trying to save gets the below warning message:

A number, currency, amount, date, time, date-time, or string is required here.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 04 Jan 2012 at 3:17am
1) I wouldn't put this in a formula, I would put it in the Report/Selection Formulas/Record, so that only the records that meet the criteria are allowed on the report (unless that is not the intent).
 
2) the error message typically means that the data types don't match...something like: a number = a string or a boolean = a date, it doesn't make sense.
 
If this is used solely in a formula, it will return just true or false, and if that is the intent, then all is well and good, if not, more will need to be added to the formula.
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