RE: [SQL] Timezone conversion

2001-04-24 Thread Francis Solomon
Hi Cedar, Does this help? select CURRENT_TIMESTAMP, CURRENT_TIMESTAMP + '90 days'; timestamp|?column? + 2001-04-24 12:57:56+01 | 2001-07-23 12:57:56+01 > > I also have a question.. How, for example, would I add 90

RE: [SQL] Date question

2001-03-06 Thread Francis Solomon
Hi Boulat, stasis=# select (now() + '1 year')::date; ?column? 2002-03-06 (1 row) Hope this helps Francis > Hi, > > Im a little bit stuck here. > > Does anyone know how to get date in format '-MM-DD' of a date one > year from now. > So for example today is '2001-03-06' I

RE: [SQL] Numeric and money

2001-01-03 Thread Francis Solomon
r money values? Is numeric(9,2) the best choice for > money? I I am using numeric(9,2) for all my "money" values with VB6 and it works fine. I use a wrapper function that I wrote to "fix up" arguments so that postgres plays nicely with them. I tend to manipulate recordset values with VB/VBA's conversion functions after they're returned, like CCur() as mentioned above. I'm willing to share my wrappers if you'd like them. Hope this helps Francis Solomon

RE: [SQL] order by day or month, etc

2001-01-03 Thread Francis Solomon
. You might try doing something like this: For a certain month/year: SELECT field FROM table WHERE date_part('year', datefield)=1999 AND date_part('month', datefield)=9; For a date range: SELECT field FROM table WHERE datefield BETWEEN '1999-09-01' AND &#x

RE: [SQL] Date/Time problem -(((

2001-01-02 Thread Francis Solomon
Hi Boris, I know Kaare Rasmussen posted a URL to the online documentation already, but this might be a direct solution to your problem: DELETE FROM onlineuser WHERE datum < ('now'::datetime - '5 minutes'::interval); Hope this helps Francis Solomon > Hello >

RE: [SQL] Query Help

2000-12-27 Thread Francis Solomon
Hi Brian, Try something like this: SELECT firstname FROM table1 WHERE firstname NOT IN (SELECT firstname FROM table2 WHERE table2.date='yesterday'::date); Hope this helps. Francis Solomon > > What do I have to do a query where information in table1 is > not in table2 &

RE: [SQL] substring ..

2000-12-19 Thread Francis Solomon
u'll get results like: @2000-12-14 @ So, you could modify your query to do: select foo from table where substr(datefoo, 1, 10) = '2000-12-14'; Alternatively, what's wrong with this approach? select foo from table where date(datefoo) = '2000-12-14'; I think that might

RE: [SQL] Date Format

2000-12-13 Thread Francis Solomon
Hi Daniel, Try this as your query: SELECT to_char(field, 'DD/MM/') AS "new name"; Hope this helps Francis Solomon > > In MS Access is: > SELECT FORMAT([field],'DD/MM/') AS new name; > How I can make in pgaccess? > > Daniel

RE: [SQL] SQL parse error

2000-12-12 Thread Francis Solomon
Hi Borek, What version of PostgreSQL are you using? This works fine for me on 7.02. Time to update, maybe? Hope this helps Francis > >Hello all, > >My following problem is: > > swports=# select substring(cp from 1 for 4)::int4 from out2cp; > ERROR: pg_atoi: error in "6.1,": can't pars

RE: [SQL] subqueries as values in updates

2000-12-08 Thread Francis Solomon
Hi, The syntax you used works fine for me. francis=# select version(); version --- PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc 2.95.2 (1 row) Hope this helps Francis Solomon > -Origi

RE: [SQL] trying to pattern match to a value contained in a column

2000-12-07 Thread Francis Solomon
tive regex match. If you really want a 'like' match, you could do this instead: SELECT * FROM abbrev where long_name~~('%' || abbr || '%'); ... where '||' is the string-concatenation operator. Hope this helps Francis Solomon > -Original Message-