Isdate() Function

Hi,

seems simple, but don’t know how to do … :slight_smile:
How can i find out if data is a correct date. Is there a isdate()

Get error, but don’t klnow what data is wrong.
image

in VBA i would do something like this …

if(isdate([field]),[Field],null())

regards,

Adrian

What is a “correct date” in your case?

Hi, good question, VBA seems to recognize everything that can be interpreted as a date - even without a format specification.

image

You can use something like the below:

isnumber(date("2022-08-04", "yyyy-MM-dd")) //returns TRUE

But the date format has to be specified beforehand. If you’re not sure about the date format, you can test several formats, for instance

isnumber(date("2022-08-04", "yyyy-MM-dd")) OR isnumber(date("2022-08-04", "dd.MM.yyyy"))

ok, thanks for reply