Joe R.
Joe R.

Reputation: 2042

How can I format a date datatype to mmm/yyyy?

ISQL Perform Screen:

I have a date column (format="mmm-dd-yyyy") used for storing "Date Manufactured". Most items that have this date (e.g. Computers, TV's, etc.) usually provide just the month and year of manufacture. I experimented using "mmm-yyyy" in Perform's attributes section, but the compiler didn't like it!.. Is there an alternative without having to use a CHAR or DATETIME YEAR TO MONTH column?

EDIT: DBDATE=MDY4-

Upvotes: 1

Views: 666

Answers (1)

Jonathan Leffler
Jonathan Leffler

Reputation: 753655

To enter a DATE in an ISQL screen, you must specify year and month and day in some order (and within broad limits, you get to control the order). The DATE must be complete, though. If you want only year and month, then you should use DATETIME YEAR TO MONTH; by definition, that does not accept a day value.

The only option left is to use the first of the month and have the form automatically provide the day value. You could experiment with PICTURE and/or FORMAT clauses, but I'm not convinced they'll help.

Upvotes: 1

Related Questions