I have an postgresql db linked to access and one of my access queries don't work. it uses the datediff function in access and the month and year functions and i wa swondering how if anyone knew how to get this to work in postgresql. here is the code that works in access but not access with postgresql.
INSERT INTO [tblBranch Problem History] ( branch, problem_code, year, month, CountOfhuman )
SELECT DISTINCTROW [tblproblems archive].branch, [tblproblems archive].problem_code, Year([problem date]) AS Year, Month([problem date]) AS month, Count([tblproblems archive].human) AS CountOfhuman
FROM [tblproblems archive]
WHERE (((DateDiff("m",[problem date],[Enter Beginning Date]))=0) AND ((DateDiff("yyyy",[problem date],[Enter Beginning Date]))=0))
GROUP BY [tblproblems archive].branch, [tblproblems archive].problem_code, Year([problem date]), Month([problem date])
HAVING ((([tblproblems archive].branch) Is Not Null));
When I take out the month and date diff lines it doesn't blow up butI don't get what I need.
Thanks in advance!
INSERT INTO [tblBranch Problem History] ( branch, problem_code, year, month, CountOfhuman )
SELECT DISTINCTROW [tblproblems archive].branch, [tblproblems archive].problem_code, Year([problem date]) AS Year, Month([problem date]) AS month, Count([tblproblems archive].human) AS CountOfhuman
FROM [tblproblems archive]
WHERE (((DateDiff("m",[problem date],[Enter Beginning Date]))=0) AND ((DateDiff("yyyy",[problem date],[Enter Beginning Date]))=0))
GROUP BY [tblproblems archive].branch, [tblproblems archive].problem_code, Year([problem date]), Month([problem date])
HAVING ((([tblproblems archive].branch) Is Not Null));
When I take out the month and date diff lines it doesn't blow up butI don't get what I need.
Thanks in advance!