Solved I Can't ALTAT tinyint

ADIGA88

Member
Local time
Tomorrow, 01:53
Joined
Apr 5, 2020
Messages
93
Hi Guys,

I am trying to change a field type using the DoCmd.RunSQL I succeed with other types but I can't change to tinyint datatype (error message attached)


Code:
 DoCmd.RunSQL "ALTER TABLE tblNotification ALTER COLUMN NotificationDate tinyint;"
 

Attachments

  • Screenshot 2021-11-27 173015.jpg
    Screenshot 2021-11-27 173015.jpg
    85.8 KB · Views: 146
Change it to some other size first to see if the problem is tinyint or something else. What is the current (i.e. before alteration) data type?
 
DoCmd.RunSQL "ALTER TABLE tblNotification ALTER COLUMN NotificationDate Integer;"
 
Byte Indeed,

It worked with the Byte Keyword and changed to (Number > Byte) in the table design view.

FYI, the datatype was INTEGER
 
I should have realized the error. TinyInt is an SQL datatype on some SQL servers but not for native Access. I mistakenly assumed you were on an SQL Server situation from that syntax.
 

Users who are viewing this thread

Back
Top Bottom