3

A synced table I setup against the 311 dataset at data.cityofnewyork.us works great!

However, the date columns come over as string, preventing me from doing date functions in queries, and from using the date columns in a Torque visualization.

I successfully issued an ALTER TABLE command to change the data type to date, but when the table is synced against source, the date columns revert back to string.

1 Answer 1

3

You can apply a dynamic query to a synced table. As in,

SELECT *, normally_text::int normally_text_as_int FROM table_name

Now, your column normally_text comes back also as a column named normally_text_as_int formatted as an integer.

int
text
numeric

Will be the key recasting methods. For dates you may need to read up a bit here, http://www.postgresql.org/docs/9.1/static/functions-datetime.html

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.