Value Fill in Date Field with a date as the value not filling the date


#1

I just created a Date field, set the field type to “Date,” selected a batch of records, and used Value Fill to enter yesterday’s date in all the selected records.

The “value” I entered to fill is:

04/05/17

The result entered into all the fields is:

01/01/

When I changed the field type to “Text” the value “04/05/17” is correctly filled in.

This is a new field that’s blank, so I’ll just go ahead and set the field type to Text and then flip it to Date when all done adding the associated dates to the records. But I’m curious as to why this is happening. Is it something I am doing incorrectly? Is it a quirk/bug in PanoX?


#2

I would call that a bug. I think that dialog should recognize that you are filling a date field and apply the date( function. It appears to be applying the val( function. When I used the date field as a formula to fill an integer field, after filling the date field with that value, the value that ended up in the integer field was 4. That’s what you get from val(“04/05/17”).

You could fill with formula instead, and use date(“yesterday”) as your formula.


#3

That’s a bug. The Fill with Value feature is really not complete, I’ll need to rework it, and add this bug to the list at that time.

What you can do now is use the Morph Field dialog, set it to Start with Date and fill in the date you want (this is just like Panorama 6).


#4

Thank you Jim


#5

The same thing seems to happen with the formulafill command.


#6

The formulafill command requires a formula – 04/05/17 by itself is not a legal formula. You would have to add quotes and the date( function, like this:

date("04/05/17")

#7

Actually, 04/05/17 by itself is a legal formula, but it means 4 divided by 5 divided by 17, not April 5th.


#8

04/05/17 would be a legal formula for a number, but the result is 0.0470588235294, which rounds to 0. That actually may have happened.


#9

I’ve discovered the same bug, but by a different avenue. I’ve been trying to move date information from one database to another. I used programming initially and nothing happened. Then I tried using ‘morph’. The screen that shows what should happen to the records gave the correct date, but when I pressed the morph button, it returned 01/01/ as per JimA’s experience. I was using the formula option to morph the field, as datepattern(lookup(“database”,Unique,Unique,DOB,""),“dd/mm/yy”)

I’ll try the text option to see if that helps get around things, but look forward to the bug being fixed…


#10

The bug that originally started this topic was fixed a long time ago, so you have not discovered the same bug. In fact, you are not even using the same dialog, since the Fill with Value dialog doesn’t have a Morph button.

You may have discovered a different bug, but you also may simply be using an incorrect formula. If you are using a lookup( from one date field to another, you should not be using the datepattern( function – that function will convert the date into text, and you don’t want that, you want to keep it as a date. I don’t really have enough information to go on, but I think your formula should simply be:

lookup("database",Unique,Unique,DOB,"")

If you want assistance with this, please tell us what the programming code you tried was. We can’t see your screen and we have no idea what you actually tried. However, I’ll take a wild guess from the rest of your post, perhaps the correct code would be something like this:

field Date
formulafill lookup("database",Unique,Unique,DOB,"")

#11

I struggle with dates, and it usually takes me multiple trial and errors to
find out which function I need to use. It was only when the morph window,
which shows the before and after fields, showed the correct response, but
the actual database field returned the 01/01/ reply, that I dared to assume
I had discovered a bug. I’m sorry, but I have moved on, and have no record
of what exactly I was using. Converting the field to a text field, and then
changing it to date, worked perfectly (and possibly supports your theory
that I was using the wrong programming).