harinder Active Member Licensed User Longtime User Aug 14, 2018 #1 I want the correct syntax for changing column name of a database. Following not working where I want to change names of 2 columns, one from old to new, other from good to bad..thnx Code: Dim chngQuery As String= "ALTER TABLE " &Main.DBTable & " CHANGE COLUMN old new CHANGE COLUMN good bad" Main.SQL1.ExecNonQuery(chngQuery)
I want the correct syntax for changing column name of a database. Following not working where I want to change names of 2 columns, one from old to new, other from good to bad..thnx Code: Dim chngQuery As String= "ALTER TABLE " &Main.DBTable & " CHANGE COLUMN old new CHANGE COLUMN good bad" Main.SQL1.ExecNonQuery(chngQuery)
OliverA Expert Licensed User Longtime User Aug 21, 2018 #41 Mahares said: When he could simply use the following without printf and get the same result unless he wants to prefix the minutes with a 0 if 1 digit Click to expand... All examples provided by @harinder throughout this thread show 2 digit minutes (for the xx:xx hour/minute combo) Mahares said: printf looks intimidating Click to expand... I'm familiar with "printf" due to some C exposure in the past. Mahares said: not too common Click to expand... If backwards compatibility is a must (see comments to this stackoverflow post: https://stackoverflow.com/a/21956882), one may look into the alternative solution I linked to above that uses substr and concatenation. Note: The question by @harinder should have probably been posted as a new forum question. At that point, others with more SQL knowledge may have lent a helping hand. Upvote 0
Mahares said: When he could simply use the following without printf and get the same result unless he wants to prefix the minutes with a 0 if 1 digit Click to expand... All examples provided by @harinder throughout this thread show 2 digit minutes (for the xx:xx hour/minute combo) Mahares said: printf looks intimidating Click to expand... I'm familiar with "printf" due to some C exposure in the past. Mahares said: not too common Click to expand... If backwards compatibility is a must (see comments to this stackoverflow post: https://stackoverflow.com/a/21956882), one may look into the alternative solution I linked to above that uses substr and concatenation. Note: The question by @harinder should have probably been posted as a new forum question. At that point, others with more SQL knowledge may have lent a helping hand.
harinder Active Member Licensed User Longtime User Aug 22, 2018 #42 Yes Mahares..point taken..but also that if H and M are taken separately, manipulated and another routine added to store HH:MM in its particular column, then it takes quite a few coding lines to accomplish the task...plus isn't sql faster to handle this task? thnx Upvote 0
Yes Mahares..point taken..but also that if H and M are taken separately, manipulated and another routine added to store HH:MM in its particular column, then it takes quite a few coding lines to accomplish the task...plus isn't sql faster to handle this task? thnx
harinder Active Member Licensed User Longtime User Aug 22, 2018 #43 OliverA said: Note: The question by @harinder should have probably been posted as a new forum question. At that point, others with more SQL knowledge may have lent a helping hand. Click to expand... Point taken for future compliance, but my post wherein I clarified with the reframing of my query giving exact table info was to clarify what I exactly wanted, else this thread was hanging at a loose end.... Upvote 0
OliverA said: Note: The question by @harinder should have probably been posted as a new forum question. At that point, others with more SQL knowledge may have lent a helping hand. Click to expand... Point taken for future compliance, but my post wherein I clarified with the reframing of my query giving exact table info was to clarify what I exactly wanted, else this thread was hanging at a loose end....