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

comparing dates with different data types

Status
Not open for further replies.

cancer2006

Programmer
Aug 25, 2006
45
US
I am using CRW 8.5 and ACCESS97
I have to select data based on the following condition.
Get all the records where date field is null or date >= 01/01/2007

I am coding as follows

If is null ({table.datefiel}) OR {table.dateield} >= "01/01/207"

Is it possible to do something like this?

 
Use Report->Recordslection->Formula and try:

(
isnull({table.datefiel})
or
{table.dateield} >= cdate(2007,1,1)
)

Consider creating a parameter instead of hard coding the date,and reference the parameter:

(
isnull({table.datefiel})
or
{table.dateield} >= {?MyParameter}
)

Why did you mention different data types in the heading and nothing in the post???

If your date info is stored in a non date type, convert it to a date and do the compare.

-k

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top