Date/time to Text question

Hi there,

I have a time log form (formA) that has two computed date/time fields.

When saved, this form generates various project time cards using another form (formB) based upon the info users punch in. Every FormB document has a button that opens its parent formA.

On formB the date/ time fields (StartDate and EndDate - computed for display - use preferences from: user settings) show up in the format mm/dd/yyyy, but i noticed some duplicate formB type documents that show the dates as dd/mm/yyyy. On these documents when i click on the button to open parent formA i get a ‘type mismatch’ error. Since these are duplicates i have been asked to delete them. So i thought of creating a separate view to filter them out and delete them.

Being a beginner it was hard for me to programetically differentiate between date and month when date is less than 12. So to give a start I created a view with selection formula i used is as follows:

SELECT Form = “timeresponse” & (@Left(@Text(BeginDate);2) > 12)

This did not give any documents at all in the view. However to test the code i created a column item as @Left(@Text(BeginDate);2) - and that returned a value in the column.

i can’t understand why this value cannot compare with numeric 12 and show relevant documents. What am i missing here?

Is there was way i could filter all the duplicate documents that have dates less or equal to 12?

Thanks for all your help!

Ayaz

Subject: Date/time to Text question

I haven’t thought through the whole thing and actually need to get to work- but @text(textvalue) returns an error- (don’t have a clue why, but it does) so, take a look at the value type (open a document, right click bring up doc properties- second tab) make are converting the right thing.

Subject: Date/time to Text question

@Left(@Text(BeginDate);2) is text. Text cannot be compared to a number; you’d need to convert the text. That being said, the real problem would seem to be that there is some code in the database that is creating text fields rather than proper date fields – probably an agent. (NotesItems are typed by their content, not by the settings on the form’s field widget. If an agent is putting text into the field, then the field content will be of type text, not date/time.)

Subject: RE: Date/time to Text question

Thanks a lot Stan!