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!

bad date-time format string 1

Status
Not open for further replies.

gav12345

Programmer
Dec 4, 2003
198
GB
Hi,

Using CR10 and Oracle 9i. I'm trying to convert a string to a datetime field (using cdatetime), but getting the above error.

The format of the string is: 21/12/2006 15:30:13

I'm not sure which formats CR can convert - any ideas how I can convert this one? I need to do this so I can compare it against another similar one.

Thanks in advance, Gavin
 
I seriously just had this error this morning.

Turned out it was trying to calculate nulls values.

What is your formula? maybe I can help...
 
Depends upon the region your machine is configured for, if you have blanks or nulls, etc.

Test using:

cdatetime("21/12/2006 15:30:13")

If that succeeds, try:

if isdatetime({table.field}) then
cdatetime({table.field})
else
cdatetime(0,0,0,0,0,0)

-k
 
mine worked when i did:
if {blah} = "" then 0 else
currentdate - date({blah})
or you could do
if isnull ({blah}) then 0 else
currentdate - date({blah})
 
Thanks for both - off work sick just now, will try those hopefully tomorrow.

gavin
 
Used the

if isdatetime({table.field}) then
cdatetime({table.field})
else
cdatetime(0,0,0,0,0,0)

...code, which did the trick. - Thanks to you both, Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top