I have a query that I want to use for extracting data form a Pervasive database and then insert to a table.
This is the first part of the query which works in PostgreSQL
SELECT d.whse, d.part_no, EXTRACT(YEAR FROM d.invoice_date), EXTRACT(MONTH FROM d.invoice_date)
FROM sales_history_items AS d
In Pervasive the invoice_date is a string like so 20141128
Can someone help me with this? Once I got this working I will post the whole query is I need more help.