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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date field

Status
Not open for further replies.

pmaxon

Programmer
Sep 25, 2003
68
US
How can I check that a date field has a date in it in a query?
 
You could try a formula like the following to see what a query is returning:

if isnull({table.date}) or
{table.date} = date(0,0,0) then
Date(9999,09,09) else
{table.date}

-LB
 
LB has suggested a means to do so using a Crystal formula, did you mean using SQL?

I know that it's a lot of work, but please post technical information, such as:

Crystal version
Database used
Example data
Expected Output

If you want to do it in a query, it would be dependent on the database used.

Otherwise it's dependent upon the version of Crystal.

More simply you might use:

isdate({table.field})

Again, this is dependent upon technical information, try checking with a software developer there if you don't know.

-k
 

I'm using CR 8.5, VB6 and Access 2000. I want to check a date field in the database to see if it has a date in it or not to produce a line in a report. If there is not a date, I don't want to use it.
 
Try placing the line in a separate section (insert section below), and then format the section above it to "Underlay following sections." Then go to format->section->section the line is in, e.g., detail_b->suppress->x+2 and enter:

isnull({table.date}) or
{table.date} = date(0,0,0)

-LB
 
isnull({table.date}) is what I needed.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top