Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Patrick Fiche
Have a try at this syntax SELECT number FROM procedures WHERE date + CAST( numdays || ' days' AS interval ) = CURRENT_TIMESTAMP; Patrick -- - Patrick Fiche email : [EMAIL PROTECTED] tél : 01 69 29 36 18

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Scott Nixon
Have a try at this syntax SELECT number FROM procedures WHERE date + CAST( numdays || ' days' AS interval ) = CURRENT_TIMESTAMP; Patrick Cool! Thanksthat works perfectly. -Scott ---(end of broadcast)--- TIP 2: you can get

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Ian Barwick
On Mon, 22 Nov 2004 15:12:26 +0100, Patrick Fiche [EMAIL PROTECTED] wrote: Have a try at this syntax SELECT number FROM procedures WHERE date + CAST( numdays || ' days' AS interval ) = CURRENT_TIMESTAMP; Just for the record you could write it like this too: SELECT number FROM procedures

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Peter Eisentraut
Ian Barwick wrote: On Mon, 22 Nov 2004 15:12:26 +0100, Patrick Fiche [EMAIL PROTECTED] wrote: Have a try at this syntax SELECT number FROM procedures WHERE date + CAST( numdays || ' days' AS interval ) = CURRENT_TIMESTAMP; Just for the record you could write it like this too:

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Scott Nixon
Just to add to the record, the mathematically sound way to write this query would be this: SELECT number FROM procedures WHERE date + numdays * interval '1 day' = current_timestamp; Thanks for that Peter! That's a lot closer than what I originally had...I didn't think about doing that

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Tom Lane
Scott Nixon [EMAIL PROTECTED] writes: Am having some trouble with a query that worked in 7.0 but not in 7.3.can't seem to figure out the syntax or find info about how to do this anywhere. SELECT number FROM procedures WHERE date + numdays = CURRENT_TIMESTAMP; In 7.0 this works with

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Scott Nixon
So I think what you probably *really* want is ... WHERE CAST(date AS date) + numdays = CURRENT_DATE; Thanks Tom! Yeah, I guess you are right on that point. I hadn't thought about that. The implementation of this wouldn't be affected since this query is buried in a script that runs