Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is my formula not printing a DATE

Status
Not open for further replies.

fiat2

Programmer
Nov 26, 2002
104
US
Using CR 10.
I've got a formula in a subreport in the Details section.
The first two results are printing when the Sample equals 1 and 2. When Sample = 3, the transdate value is not printed. When I modify the code, so that Test is uncommented, it prints as well. The SQL used by this subreport returns a value for the transdate...stumped

Code:
If {VW_RDE_LDS_MOLD_DATA.SAMPLE} = 1 Then
{VW_RDE_LDS_MOLD_DATA.OPERATORID}
Else IF {VW_RDE_LDS_MOLD_DATA.SAMPLE} = 2 Then
"Trans Date"
Else IF {VW_RDE_LDS_MOLD_DATA.SAMPLE} = 3 Then
totext({VW_RDE_LDS_MOLD_DATA.TRANSDATE})
//"Test"
 
What happens if you just use

totext({VW_RDE_LDS_MOLD_DATA.TRANSDATE})

as a formula?

Ian
 
This is weird to me. If I select Show SQL Query, the query there produces a recordset containing data for transdate. If I place that database field on the report, no data is displayed.

It appears that the issue is not in the formula but rather what is returned in the recordset.

weird to me.
 
Is the recordset coming from a view, if yes please show the SQL for the view query. Crystal can be very temperamental when dealing with date queries.

What is the date format in recordset

Ian
 
The date field data from the database was listed as 2/9/0008

CR does not display dates before a certin year, something like 100.

So this was an issue of the invalid data from the datbase.

Thanks to all.
 
What is the format of {VW_RDE_LDS_MOLD_DATA.OPERATORID} ?

Is it possible that {VW_RDE_LDS_MOLD_DATA.SAMPLE} could be null?
 
As Charliy says, you may have null values. These always stop the formula without output. Test for IsNull first.

You might also have a value greater than three. Add an extra detail line to 'debut' the problem, show the value of {VW_RDE_LDS_MOLD_DATA.SAMPLE} and the other fields. (They too might be blank or null.)

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
The issue was that {VW_RDE_LDS_MOLD_DATA.TRANSDATE} field, which is of type DATE was an invalid date.
The date was listed as 2/9/0008

After correcting the database data, the CR field contained data...for the same record.

Thanks to all.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top