How do you prevent Date Fields from converting to Text Fields?

I have a value OrderDate which is text. I want to replace the CloseDate field with the OrderDate value. I when I used the code below the CloseDate field is change to a text field.How do I prevent this from happening?

Set Clodate = New NotesDateTime(Format(Cdat(OrderDate), “General Date”))

Call doc.ReplaceItemValue(“CloseDate”,Clodate.LocalTime)

Subject: How do you prevent Date Fields from converting to Text Fields?

From designer help “LocalTime: A string representing a date-time”

Try:

Call doc.ReplaceItemValue(“CloseDate”,Clodate.LsLocalTime)

HTH - Rufus.

Subject: RE: How do you prevent Date Fields from converting to Text Fields?

I want to input the value in the date field as date only, I want to exclude the time.

Subject: RE: How do you prevent Date Fields from converting to Text Fields?

Call Clodate.setAnyTime()

HTH - Rufus.

Subject: RE: How do you prevent Date Fields from converting to Text Fields?

Works Perfect!

Thanks

Subject: How do you prevent Date Fields from converting to Text Fields?

I do not think you need to format your notes datetime value. I think you should be able to do this:

Clodate = New NotesDateTime(OrderDate)

Call doc.ReplaceItemValue(“CloseDate”,Clodate.LocalTime)

According to the notesDateTime class, the parameter that you are assigning to a notesDateTime object can be a string, so there should be no reason to have to Cdat it and Format it.

Then…according to the ReplaceItemValue method documentation, a data type value of NotesDateTime will result in a date-time item containing the date-time represented by the object.

I think this may help…but I do know that you really do not need to format and cdat your order date. The notesDateTime class will take care of that for you.