Avatar of rustypoot
rustypoot
Flag for United States of America asked on

Crystal Reports - Date Formula Error

I have a formaula in the report - CDateTime({hsp_eMARDowntime_DailyTasks;1.VacInfoDate})

When I run this report locally on my Pc, it runs without any errors! When I post the rpeort to BOE, it errors out - 'Error in formula <VacInfoDate>. 'CDateTime({hsp_eMARDowntime_DailyTasks;1.VacInfoDate})' Bad date-time format string. Details: errorKind'

How can I fix this error? I need this ASAp. Thanks
Crystal Reports

Avatar of undefined
Last Comment
James0628

8/22/2022 - Mon
Mike McCracken

What are the values in the field?

WHat are the settings on your machine and the BOE machine for default dates?
GO to Control Panel --> REGIONAL SETTINGS
One is probably dd/mm/yyyy and the other is mm/dd/yyyy

mlmcc
Mike McCracken

Can the value be NULL?

If so you need to check for that first

If Not IsNull({hsp_eMARDowntime_DailyTasks;1.VacInfoDate}) then
    CDateTime({hsp_eMARDowntime_DailyTasks;1.VacInfoDate})

mlmcc
rustypoot

ASKER
I checked the REgional SEttings on my PC and the server and they match.

The value is NULL most of the time.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Mike McCracken

Try using the foemula with the test in it.

mlmcc
rustypoot

ASKER
I tried using the formula you gave but same error!
Mike McCracken

Are you running against the same database?  Same data?

mlmcc
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
rustypoot

ASKER
Yes i am running against the same database and same data! It runs on my Pc but not on the portal!
ASKER CERTIFIED SOLUTION
James0628

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
rustypoot

ASKER
Thx James
James0628

You're welcome.  But, just out of curiosity, did you figure out what values were causing the error, and why you were getting the error on BOE, but not the local PC?  My post wasn't really a solution.  Just something to help diagnose the problem.  Technically, using IsDateTime might allow you to avoid the errors, but it doesn't address the real problem/question (why you're getting errors on BOE, but not on your local PC).

 James
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck