Select Blank Dates


#1

In Pan 6, the code

Select «myDate» = date("")

will select all records with no entry in the date field. But Pan X doesn’t allow this. How does one select records with no date entry? I can’t find this in the Help files.

Regards,
Vic


#2

For what it’s worth, this statement

Select «MyDate» = ""

selects records in Pan 6 as your example (correctly, without error), as well as the same records in Pan X (which is none). Funny, when I try your example with date("") in 6 it responds with “Illegal date”. Does it not do that for you? I am doing this in the dialog, not procedurally.


#3

Select val(myDate)=0


#4

The Find/Select Menu popups offer the options “is empty” and “is not empty” for fields, eg. My Date is empty (no chevrons as the field name is also picked by a popup.

But that syntax gets rejected procedurally. Instead use Select emptycell(«My Date»), or Select not emptycell(«My Date») which should work for any field data type.

The emptycell( function is new in X and will be very useful once I learn to stop thinking in Panorama 6 mode, where picking the correct test for empty data records was situational.


#5

I didn’t even realize that would work. I would have recommended this code for finding empty data in any type of field. This will work in both Panorama 6 or X.

select sizeof("myDate")=0

As John mentioned, in Panorama X you can now use emptycell( to do the same thing a bit simpler.

I did some testing, and in Panorama 6,

date("") --> zero

while in Panorama X

date("") --> Error: Invalid date

It would be pretty easy to change the date( function in Panorama X so that it also returned zero instead of an error. I don’t have a strong feeling about it either way. What do you think that date("") should return?

  • Return zero
  • Return error

0 voters


#6

Hello To All,

Staylor246: Can’t figure your response out. In my Pan 6, the code Select «MyDate» = date("") correctly returns all empty results, while Select «MyDate = “” gives me an error.

gary: Thanks Gary.

JohnB: I hadn’t known about the emptycell( function. That looks like the trick, for date fields as well as others. That’s the one I’ll use. I think a reference to that function should be added and highlighted in the Help file.

Jim: I responded to your survey, but with the emptycell( function, my question isn’t important any more. The emptycell( function is a good addition to Pan X.

Best regards,
Vic


#7

Actually that’s where I found it. I’d spotted empty as an option in the menus and your post reminded me I’d meant to check for procedural equivalents. I just searched Help for ‘empty.’


#8

Hello Jim,

Just one interesting last word on this topic. The code

Select «myDate» = date("")

was generated BY PANORAMA 6 with the macro recorder. Is this an instance of where the Master is surprised by his own creation?

Best regards,
Vic


#9

Yes, it is. :slight_smile:


#10

I forgot to post a link to the Bitbucket issue for this, which I created yesterday: