Dear Cristian & David, Thanks alot for your responses.
Cristian - I don't have money to buy additional software unfortunately. With regard to 'view' I actually don't know what this is. I'm a bit of a beginner. I wonder if I made a 'view' whether I could then query that view with QGIS. Something for me to look into... David - That looks like a good idea... but when adding data to QGIS you can only select the whole table (I think) and then you manually enter the 'WHERE' clause in a dialog box. I guess I could run the query you suggest in PostgreSQL and save it into another table... and then link QGIS to the new table. Though it all starts to get a bit convoluted if I have to do that every time I want to look at some data in QGIS... Cheers James On 15 June 2011 19:16, David Fawcett <david.fawc...@gmail.com> wrote: > This is what is really cool about using a database to store your data... > > Change your query to: > > SELECT mycol1, > mycol2, > date_time_of_arrival as dt_arrive, > date_time_of_departure as dt_depart, > the_geom > FROM incidents > WHERE urgency = 'Immediate' > AND date_time_of_arrival - date_time_unit_assigned > '00:12:00' > > Note: you will need to specify the names of the columns that you are > interested in. > > > On Wed, Jun 15, 2011 at 12:58 PM, James David Smith > <james.david.sm...@gmail.com> wrote: >> Dear all, >> >> I appreciate that this is more of a QGIS query, but I think that the >> route of the problem might be in PostGIS, so... I have opened QGIS and >> ran the query on my PostGIS table as below: >> >> SELECT * FROM incidents >> WHERE urgency = 'Immediate' >> AND date_time_of_arrival - date_time_unit_assigned > '00:12:00' >> >> This gives me 33 points in QGIS. Great. I would now however like to >> save this as a ShapeFile for use in ArcGIS with which I am more >> familiar, but when I try to SAVE AS from QGIS I am given the following >> error.... >> >> Export to vector file failed. >> Error: trimming attribute name 'date_time_of_arrival' to ten >> significant characters produces duplicate column name. >> >> I am guessing that the problem here is that ESRI shapefiles can only >> deal with column names that are ten characters long...? And that as I >> also have a column called 'date_time_of_departure', when QGIS trims >> this column it ends up with two columns called the same thing? Is >> there a way around this? I realise I could rename the column in QGIS, >> but I actually have around 45 columns in the table and this problem >> will occur with about 15 pairs of them I think. I guess there is no >> simple answer... but thought I'd ask. >> >> Cheers >> >> James >> _______________________________________________ >> postgis-users mailing list >> postgis-users@postgis.refractions.net >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> > _______________________________________________ > postgis-users mailing list > postgis-users@postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users