I am a relatively new to SQL queries and have been struggling for weeks to solve what I imagined to be a simple problem.
I am using MS Query from within Excel 2016 to query the company's main database. This supports PostgreSQL - I don't know which version - only that it is unlikely to have been updated since 2012.
I routinely run queries successfully - a simple example of a date criterium is:-
WHERE (pihist.description Like '%COCA%') AND (pihist.inv_date>={d '2018-05-01'})
- this happily returns all instances where the invoice date in the pihist table is equal to or greater than 1st May 2018
However I am wanting to select all records where the date is - say - in the past 30 days.
I have tried multiple functions without success - e.g. (pihist.inv_date>='current_date()-30') ..... BUT this returns :- "ERROR: date/time value "current" is no longer supported; Error while executing the query"
All guidance will be gratefully received.
Malc0Savs
I am using MS Query from within Excel 2016 to query the company's main database. This supports PostgreSQL - I don't know which version - only that it is unlikely to have been updated since 2012.
I routinely run queries successfully - a simple example of a date criterium is:-
WHERE (pihist.description Like '%COCA%') AND (pihist.inv_date>={d '2018-05-01'})
- this happily returns all instances where the invoice date in the pihist table is equal to or greater than 1st May 2018
However I am wanting to select all records where the date is - say - in the past 30 days.
I have tried multiple functions without success - e.g. (pihist.inv_date>='current_date()-30') ..... BUT this returns :- "ERROR: date/time value "current" is no longer supported; Error while executing the query"
All guidance will be gratefully received.
Malc0Savs