[Solved] Change the properties of a field in a query

Discuss the database features
Post Reply
klausk
Posts: 19
Joined: Thu May 28, 2009 9:07 pm

[Solved] Change the properties of a field in a query

Post by klausk »

My Base database has a connection to csv files. There I want to convert the field "its_m2" from string to integer in a query. Is that possible?
Attachments
TabexportTest.csv
(92 Bytes) Downloaded 90 times
Last edited by Hagar Delest on Mon May 01, 2023 2:27 pm, edited 2 times in total.
Reason: tagged solved.
OOo 3.1.X on Ubuntu 8.x + opensuse 11.1
User avatar
robleyd
Moderator
Posts: 5056
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Change the properties of a field in a query

Post by robleyd »

If you are using the default HSQL to open the CSV directly as a data source, it supports CONVERT() and CAST() which may do what you want. See the documentation - search the page for CONVERT(.

If you are importing the CSV into Calc to use as a data source and if you have control over the creation of the CSV file, don't use quotes around numeric values. If you don't have control of the CSV creation make sure to uncheck Quoted fields as text under Other Options in the Text Import dialog.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
klausk
Posts: 19
Joined: Thu May 28, 2009 9:07 pm

[SOLVED]Change the properties of a field in a query

Post by klausk »

thx, I definded TAB as seperator
OOo 3.1.X on Ubuntu 8.x + opensuse 11.1
Post Reply