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!

Error in Formula regarding data formats

Status
Not open for further replies.

jfokas

Programmer
Apr 28, 2002
42
0
0
I get an an error when running the following formula:

IF CURRENTDATE - 30 < DATE({QUERY.AgingDate}) THEN 1 ELSE 0

The AgingDate field is a string field with the following format: 2004/04/15 13:42:00.00

The error I get states the following:

Error: Bad date format string
--{QUERY.AgingDate}: "2004/04/15 13:42:00.00"
--CurrentDate - 30: #2004-4-17#

I've tried manipulating the format several different ways, to no avail. Can an anyone tell me what we're misssing?

Thanks!


 
Since the date is a string field, have you tried using CDate?

CDate({QUERY.AgingDate}) instead of DATE({QUERY.AgingDate})
 
Try the following:

if currentdate - 30 < date(val(left({table.stringdate},4)),val(mid({table.stringdate},6,2)),val(mid({table.stringdate},9,2))) then 1 else 0

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top