Displaying a Date in Pan X

I am having enormous trouble doing a simple task like displaying a date.

I have imported Pan 6 databases and they have not problem and when I inspect them in Pan X on object properties and all that stuff and compare it with a Newly Created Pan X database there seems no apparent difference.

I get no joy. Hours shot on such a trivial goal.

Here is the Procedure which simply creates a new record, puts a unique ID in, and records the date it was created and creates a second date for when last modified.

;

;-------------------------------Called “.NewRecord”
;Puts unique ID number in field ID for smart merge routines
local OptionKey
AddRecord
;
ID=uniqueid(“ID”,“DigitalDevices—”)
;
«First Entered»=datepattern(today(),“mm/dd/yyyy”)
«Last Modified»=today()

The record is created, the ID, the numeric value for the date, just no matter what I do the number stays instead of a formatted date displayed.

This seems really hard to do vs. Pan 6.

Thanks

George

It looks like you are putting the string datepattern(today(),“mm/dd/yyyy”) into «First Entered» instead of the date value today(), which is numeric. You probably want «First Entered» to be a date field, equal to today(), and have it displayed with the “mm/dd/yyyy” format.

George, you need that datepattern formula only if you are using text fields for «First Entered» and «Last Modified». You are using it for the first field, but not for the second field.

As Bruce says, you should use date fields for those fields (with properly set output format). Then this would be enough code:

AddRecord
ID=uniqueid(“ID”,“DigitalDevices—”)
«First Entered»=today()
«Last Modified»=today()

Ahhh.

I could not figure out how to change it to a date field.

It appears that in a form you cannot change the field properties from number to date.

You have to be in the datasheet mode and then you can change the type.

Not a big deal but can you change the type by being in a form? I know the trick now but I was clearly stymied. The only way I see it is when you are in the data sheet view.

Not intuitive for me but then again I may have just missed something.

Thanks. Onward migrating.

But this is basically the same way like in Panorama 6.

The only difference in Pan X is that you do not have “Data Field” objects in forms anymore. (Instead you would use formulas in text objects.)

It’s not quite the same. I think it was rarely used, in fact I had to go back to try it because I wasn’t sure, but in Panorama 6 you could click on a Data Cell object, then choose Field Properties from the Setup menu, and change the field type there. I think this feature was relatively recent, maybe Panorama 5 or 5.5. Before that you could only change field properties (including data type) from the design sheet.

In Panorama X you can only change field properties from the data sheet, so it’s like earlier versions of Panorama except that you use the data sheet instead of the design sheet.