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!

Adding a date formula to Crysal 1

Status
Not open for further replies.

cntlr001

IS-IT--Management
Feb 18, 2011
5
US
I an trying to pull all items that are 2 years old (or older) that have no use by using the following formula.

{timWhseBinInvt.QtyOnHand} <> 0.00 and
not ({timItem.ItemID} startswith "*") and
{tglAccount.GLAcctNo} in ["1200000", "1205000", "1400000", "1405000"] and <= Date (2009,04,30)

It gives me the following error

A number, Currency amount, Boolean, Date-Time, or string is expected here.

I am using Crystal Reports X (10) The formula work up until the last AND statement, when I add that it bombs out. Please Help.
 
You hve not enetered a date field to compare with the date you have entered

{timWhseBinInvt.QtyOnHand} <> 0.00 andnot ({timItem.ItemID} startswith "*") and{tglAccount.GLAcctNo} in ["1200000", "1205000", "1400000", "1405000"]

and {Datefield required here} <= Date (2009,04,30)

Ian
 
If it's not a one-off report, it would be better to use
Code:
DateDiff("yyyy", {your.date}, currentdate) >= 2
This would stay true whenever you run it.

I notice your test would exclude accounts that are currently less than two years old. Is that intentional? You can also use DateDiff for a number of months.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top