Re: [SQL] Comparing Dates

2004-11-18 Thread Thomas F.O'Connell
Ha. Why so it is. :) -tfo -- Thomas F. O'Connell Co-Founder, Information Architect Sitening, LLC http://www.sitening.com/ 110 30th Avenue North, Suite 6 Nashville, TN 37203-6320 615-260-0005 On Nov 18, 2004, at 11:50 PM, Greg Stark wrote: "Thomas F.O'Connell" <[EMAIL PROTECTED]> writes: select 2004

Re: [SQL] Comparing Dates

2004-11-18 Thread Greg Stark
"Thomas F.O'Connell" <[EMAIL PROTECTED]> writes: > select 2004-06-08; > ?column? > -- > 1990 > > I'm not exactly sure how the bare string is converted internally, but it's > clearly not a complete date like you're expecting. What string? That's just integer arithmetic. -- greg

Re: [SQL] Comparing Dates

2004-11-18 Thread Nick Peters
Thanks, it turns out that the code that was executing the sql was flawed. Thanks to all that replied! -Nick Ian Barwick wrote: On Thu, 18 Nov 2004 15:01:58 -0600, Nick Peters <[EMAIL PROTECTED]> wrote: Hey, I am trying to compare dates in a sql statement. this is what i have tried: SELECT * FR

Re: [SQL] Comparing Dates

2004-11-18 Thread Thomas F.O'Connell
Nick, You need to quote your date constant value: '2004-06-08' select '2004-06-08'::date > 2004-06-08; ?column? -- t (1 row) select 2004-06-08; ?column? -- 1990 I'm not exactly sure how the bare string is converted internally, but it's clearly not a complete date like you'r

Re: [SQL] Comparing Dates

2004-11-18 Thread Ian Barwick
On Thu, 18 Nov 2004 15:01:58 -0600, Nick Peters <[EMAIL PROTECTED]> wrote: > Hey, > > I am trying to compare dates in a sql statement. this is what i have tried: > > SELECT * FROM transactions WHERE shippingdate>2004-06-08 AND > transtype='Sale'; SELECT * FROM transactions WHERE shippingdate> '2

[SQL] Comparing Dates

2004-11-18 Thread Nick Peters
Hey, I am trying to compare dates in a sql statement. this is what i have tried: SELECT * FROM transactions WHERE shippingdate>2004-06-08 AND transtype='Sale'; but it returns all rows. When i switch the > with a < it returns nothing. I have even tried with todays date and have got the same resu

Re: [SQL] session_id

2004-11-18 Thread Riccardo G. Facchini
--- Michael Fuhr <__> wrote: > On Wed, Nov 17, 2004 at 06:25:25AM -0800, Riccardo G. Facchini wrote: > > > > --- Richard Huxton <__> wrote: > > > > > > Add a new sequence to your database: > > [snip] > > > Good idea, but it won't work for what I need. > > I'll be able to do get the nextval('my