Page 1 of 2
How to change the data type of a database column?
Posted: Mon Aug 27, 2012 4:38 am
by Gail
I imported my database data into a Tiggzi db new collection via a csv file, however all of my date columns were set to a data type of STRING. How can I edit my Date columns to make their data type DATE?
How to change the data type of a database column?
Posted: Mon Aug 27, 2012 5:04 am
by maxkatz
When you import the file, the first row can contain the column types. For example:
"Name:string", "Account:number"
How to change the data type of a database column?
Posted: Mon Aug 27, 2012 7:51 am
by Gail
I have the column names in the first row. Would it work if I had the data types in the second row of the spreadsheet?
How to change the data type of a database column?
Posted: Tue Aug 28, 2012 12:11 am
by Gail
Thanks. I've added the data types to my csv file. However, when I try to import the csv file, I get the following message: Cannot parse incoming date with metaData="date" and value="01/25/06"
What format does the data in my date column in my csv need to be to get the data types to match? I have set the format of my date column to be one of the Date formats from the csv date format options.
How to change the data type of a database column?
Posted: Tue Aug 28, 2012 12:14 am
by maxkatz
Date has to be in this format:
Mon, 16 Jul 2012 15:36:03 GMT
How to change the data type of a database column?
Posted: Tue Aug 28, 2012 2:16 am
by Gail
Even when I put it in that date format, I get this error message:
Cannot parse incoming date with metaData="date" and value="Thu, 25 Jan 1906"
Is it necessary to include the time on all dates? If so, is a time of 00:00:00 acceptable, since my data really doesn't have a time?
The error message makes it look more like my date is being read as a string.
How to change the data type of a database column?
Posted: Tue Aug 28, 2012 2:53 am
by maxkatz
Can you share a sample from your file (2-3 rows)?
How to change the data type of a database column?
Posted: Wed Aug 29, 2012 12:28 am
by Gail
StartDate:date EndDate:date
Thu, 25 Jan 1906 Mon, 12 Feb 2007
Wed, 13 Feb 1907 Fri, 1 Feb 2008
I tried changing the format of the cells in the csv from Date to something else, but when I do that, it no longer displays the years correctly.
How to change the data type of a database column?
Posted: Wed Aug 29, 2012 12:51 am
by maxkatz
This works:
"name:string", "somedate:date"
"joe", "2012-09-14 17:45:30.250"
How to change the data type of a database column?
Posted: Wed Aug 29, 2012 1:19 am
by Gail
Ok, thanks. I was able to import the date column in that format, but without the time portion of it.
I would like to import a time into a separate column in the database that holds only the time. For example: 11:00:00 Is that possible to import ONLY the time, as the data column really doesn't have a date? I would like the database column to be of data time date, so I can query for a time input by the user.