How to get column data type and format

Database
Enthusiast

How to get column data type and format

I am working on one automation process where data will be fetched from a table based on qualifying key passed as parameter. That qualifying key can be of type date/timestamp. I need to handle all formats of date in the where statement and if the type is timestamp,no need to convert timestamp to any format, just use that column in the where statement.

Any way to handle both date and timestamp in one where statement?

Thanks,

Hanu