Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Crystal Report Formula Post Reply Post New Topic
Page  of 2 Next >>
Author Message
vpriyanka2001
Groupie
Groupie


Joined: 28 May 2009
Online Status: Offline
Posts: 59
Quote vpriyanka2001 Replybullet Topic: Crystal Report Formula
    Posted: 27 Aug 2009 at 6:17am
My Formula below is giving error on line 2, it says String is required here.
I am using 2 tables to get my data, command and command1.

Please Please help me.


IIF ({command.date_app_entered} <> #1/1/1900# and {Command_1.date_app_recvd} <> #1/1/1900# and
    {command.date_qt_mailed} = #1/1/1900# and {command.date_gen_letter} = #1/1/1900# and
    {command.date_declined} = #1/1/1900# , "YES" ,  "NO")
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Aug 2009 at 7:26am
Verify that the field in question is a date/datetime field and not a string that looks like a date/datetime.

Edited by DBlank - 27 Aug 2009 at 7:26am
IP IP Logged
vpriyanka2001
Groupie
Groupie


Joined: 28 May 2009
Online Status: Offline
Posts: 59
Quote vpriyanka2001 Replybullet Posted: 27 Aug 2009 at 7:55am
IIF ({command.date_app_entered} <> #1/1/1900# and {command.date_app_recvd} <> #1/1/1900# and
    {command.date_qt_mailed} = #1/1/1900# and {command.date_gen_letter} = #1/1/1900# and
    {command.date_declined} = #1/1/1900# , "YES" ,  "NO")

Date app Received is a VarChar in Database
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Aug 2009 at 7:59am
depends on what you are trying to do here. Are you looking for NULLS
... and NOT (isnull({command.date_app_recvd})) and ...
 
or the not a string of "1/1/1900"
... and todate({command.date_app_recvd}) <> #1/1/1900# and ...
 
IP IP Logged
vpriyanka2001
Groupie
Groupie


Joined: 28 May 2009
Online Status: Offline
Posts: 59
Quote vpriyanka2001 Replybullet Posted: 27 Aug 2009 at 8:05am
No I am not looking for nulls, I am looking for value.
I
IF ({command.date_app_entered} <> #1/1/1900# and todate({command.date_app_recvd}) <> #1/1/1900# and
    {command.date_qt_mailed} = #1/1/1900# and {command.date_gen_letter} = #1/1/1900# and
    {command.date_declined} = #1/1/1900# , "YES" ,  "NO")

I am getting error at todate (a number, boolean, date or string is expected here)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Aug 2009 at 8:46am
Oops try,
cdate({command.date_app_recvd}) <> #1/1/1900#


Edited by DBlank - 27 Aug 2009 at 8:46am
IP IP Logged
vpriyanka2001
Groupie
Groupie


Joined: 28 May 2009
Online Status: Offline
Posts: 59
Quote vpriyanka2001 Replybullet Posted: 27 Aug 2009 at 8:52am
If I do C date, I get date as 1994-03-30 00:00:00

This is how my date is coming and I cannot even change the format. I don't see date and time format TAB to change it.

I want to see date as 02/04/2009


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Aug 2009 at 8:55am
Let's take a step back.
1. What are you ultimately trying to do with this formula?
2. What exactly does the string look like? (give me 2 examples please).
Thanks.
IP IP Logged
vpriyanka2001
Groupie
Groupie


Joined: 28 May 2009
Online Status: Offline
Posts: 59
Quote vpriyanka2001 Replybullet Posted: 27 Aug 2009 at 9:10am
I have an existing report, which is using one field called data_app_recvd and all other fields from table name Dateinfo

I have to change the report database, I can do that but now the field data_app_recvd. I have to get from another table called policy.

I did create a Command to do the Join

select
d.ISN,
d.name_ins,
d.lifecycle_status,
d.date_app_entered,
p.date_app_recvd,
d.date_qt_mailed,
d.date_gen_letter,
d.date_declined,
d.uwinits,
d.bornum

from DateInfo D,
policy P

where
d.OBJECT_NUM  = p.POLICY_NUM


OLD formula I need to update is

IIF ({date_info.date_app_entered} <> #1/1/1900# and {date_info.date_app_recvd} <> #1/1/1900# and
    {date_info.date_qt_mailed} = #1/1/1900# and {date_info.date_gen_letter} = #1/1/1900# and
    {date_info.date_declined} = #1/1/1900# , "YES" ,  "NO")

My Updated formula to get data:

IIF ({command.date_app_entered} <> #1/1/1900# and cdate({command.date_app_recvd}) <> #1/1/1900# and
    {command.date_qt_mailed} = #1/1/1900# and {command.date_gen_letter} = #1/1/1900# and
    {command.date_declined} = #1/1/1900# , "YES" ,  "NO")

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Aug 2009 at 9:24am
What are some of the values from {command.date_app_recvd} including the 1-1-1900 value you are comparing to?
IP IP Logged
Page  of 2 Next >>
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.