Create Table datetime syntax issue

How does a datetime need to be put in to Create a Table with script. This is my script but it hates the datetime setup.

I would also like to auto generate folders and tags in the default tag database using script. Any examples would help. My project is going out to several plants and I am doing code to auto generate all the items they need to make the project work.

Try delete the first open parenthesis, then move the last triple quotes to the right of the close parenthesis, like this:

qry = """Create Table JSU_HeaderInfos(
column1 datatype1,
column2 datatype2,
columnN datatypeN)"""

The actual query setup works but using datetime or date does not make the query happy. The rest of it works when omitting t_stamp.

Is this MSSQL?

What flavor of DB are you using?

It is MSSQL.

So I figured out the issue creating the table but i still need help creating and adding folders and tags using script to the default tag db.

Glad you fixed it. Please share what the resolution was :slightly_smiling_face:

Missing parenthesis at the end and the quotes needed moved outside of the first set.

Still need to figure out using script to create tags and folders in the tag database though.

That’s exactly what @ajdewhirst1 told you to do ! hint: You don’t need the outer parentheses.

1 Like