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!

Bad Date Time Format --HELP

Status
Not open for further replies.

rhoneyfi

MIS
Apr 8, 2002
200
US
I have a string (call it 'Time_In' that I am converting to Date Time format .
I use the formula cdatetime ({Time_In}). It compiles and works fine when I insert the formula into the report.

I have another string (call it 'Time_Out') that I am also converting to Date Time format.
I used the same formaula: cdatetime ({Time_Out')). It compiles OK but when I put it in the report and run the report, Crystal goes to the formula edit window for the Time_Out formula and gives the error "Bad Date Time Format String" ... Any ideas why this could be happening??? I am stumped!
 
Does the second one sometimes have a null value that you are not testing for ?

Can you identify which string is failing ? If it is all of them, then the two strings are probably not as similar as they appear. If it is just selected ones, perhaps they have a subtly different format because of their value (11:05 could be stored as "11:5" if leading zeros are being ignored, for example)
 
I discovered some of the records in Time_Out are blanks....what's the wasiest way to filter them out of the report? Thanks
 
Include

WHERE Time_Out IS NOT NULL

in your SQL query.
 
Eeek, soory about the last question... I figured it out .

Time_Out <> &quot; &quot;

 
Do you really want to lose all your rows with {Time_In} where there is no {Time_Out}?

You could use this formula instead of your field {Time_Out}:

if isnull({Time_Out}) or
{Time_Out} = &quot;&quot; then Date(0,0,0) else
cdatetime({Time_Out})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top