I am working with Postgresql database. I need to get date which is two weeks prior to current date using Postgresql database.
select date(now() - interval '2 week') from test_base
If today's date is 2014-05-08 then above sql should give me 2014-04-24?
But somehow above query is not working at all?
SELECT now() - interval '2 week';
This works just fine. What is the exact error you are getting?
Since you are not pulling any data from table test_base there is no need to include that in a FROM clause.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With