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!

? what ERROR Means

Status
Not open for further replies.

sxmnl

Technical User
Dec 17, 2002
28
US
Ok I'm getting a error !A date-time is required here

and I'm not sure why ? any clues

my code looks like this

{PDL_TASK_VIEW.FCREATIONTIME} >= datetime(year(currentdate),month(currentdate),day(currentdate),5,45,0)

I have a program that runs some math at 05:55:am every day. But I want to grab the new values for that day and
add too a report for that day.

Thanks
I'm new to crystal and I run this code in other reports and it works?

 
I would say it is because {PDL_TASK_VIEW.FCREATIONTIME} is probably a time field and not a datetime field.


Mike
If you're not part of the solution, you're part of the precipitate.
 
Ok, Then how would the correct format of the code Look.

Thanks in Advance
 
You would need to (if it exists) bring in the field that contains the date and use it to create a datetime field.

Create this formula:
============================================================
timevar t1:={PDL_TASK_VIEW.FCREATIONTIME};
datevar d1:={your date field};
datetimevar dt;

dt:=datetime(year(d1),month(d1),day(d1),hour(t1),minute(t1),second(t1))
===========================================================

Then compare this formula to your "datetime(year(currentdate),month(currentdate),day(currentdate),5,45,0)" Mike
If you're not part of the solution, you're part of the precipitate.
 
I'm sorry you really went over my head on that, I'm new to Crystal so please be gentle.
the PDL_TASK_VIEW.FCREATIONTIME is a string value.
so I'm woundering if I can convert this to a datetime value then try and use my original code ??

{PDL_TASK_VIEW.FCREATIONTIME} >= datetime(year(currentdate),month(currentdate),day(currentdate),5,45,0)

or somthing easy

Thanks
 
What does the tpyic {PDL_TASK_VIEW.FCREATIONTIME} look like?

It is possible to convert it to a datetime field, but I would need to see the formatting.

By the format, I mean is it "YYYY/MM/DD_HH:mm:SS" or something like this. Mike
If you're not part of the solution, you're part of the precipitate.
 
ok here is the exact format

29-Jan-2003 04:51:05

that is the {PDL_TASK_VIEW.FCREATIONTIME}
 
It's easier than I thought (if you have CR8 or higher)

Create this formula:

cdatetime({PDL_TASK_VIEW.FCREATIONTIME})

to convert the string to a date time field, then use the formula to compare to your{PDL_TASK_VIEW.FCREATIONTIME} >= datetime(year(currentdate),month(currentdate),day(currentdate),5,45,0)


If this doesn't work, let me know I and I'll see if I can come with an alternate formula Mike
If you're not part of the solution, you're part of the precipitate.
 
ok it did not work. I tried a couple of different things
this code below does convert correctly.
cdatetime({PDL_TASK_VIEW.FCREATIONTIME})

But when I try to use it with

cdatetime{PDL_TASK_VIEW.FCREATIONTIME} >= datetime(year(currentdate),month(currentdate),day(currentdate),5,45,0)

Any more Ideas ? Hey really appreciate the help



 
sxmnl,

You always need to use brackets in conjunction with the CDateTime function (and indeed all functions, for that matter). Copy and paste this into your formula:

cdatetime({PDL_TASK_VIEW.FCREATIONTIME}) >= datetime(year(currentdate),month(currentdate),day(currentdate),5,45,0)

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top