I was pointed to the FUNCTIONS list and tried all the variations you can imagine around YEAR(), CURDATE(), CURRENT_TIMESTAMP, TO_CHAR() and I can't remember which others. I entered these into the SQL window in this command:
No matter what's at the end of the command I get this error:ALTER TABLE "Respondent" ALTER COLUMN "RespondentYear" SET DEFAULT "YEAR(CURDATE())"
I have altered the field type for RespondentYear many times:Wrong data type or data too long in DEFAULT clause: YEAR(CURDATE()) in statement [ALTER TABLE "Respondent"ALTER COLUMN "RespondentYear" SET DEFAULT "YEAR(CURDATE())"]
date
char fixed (100 also 4)
var char (100)
number
integer
still the same error.
If I remove the " " around the function it just balks at YEAR.
OK. That's the history; why I'm here.
Is there a macro that will do this? I searched this forum for Year Base and got nil response hence this post. The macros list doesn't seem to include one either.
What I want to do is either a simple YEAR(CURDATE()), or store CURDATE() in some temporary variable and apply YEAR() to that variable. I tried something like that with what little I remember but it doesn't work. Could be the functions don't exist in the basic that is being used.
It has been decades since I wrote macros in basic so assume I have forgotten all I knew.
Thanks for any help.