The sql in the editor is not working correctly when using or statements. Normally the statement would be without the bold part, when i copy it in pgadmin that is the query to gets me the answers that i would want. When quering in vstudio i have to repeat the bold part as shown in the underlined part of the query below. If I don't repeat put the bold part in the query it will only show the results for ( EXTRACT(MONTH FROM "hrs_date" = 5 OR EXTRACT(MONTH FROM "hrs_date" = 6 instead of also OR EXTRACT(MONTH FROM "hrs_date" = 7.
SELECT hrs_prs_fkey, hrs_cln_fkey, hrs_taskname, hrs_date, hrs_starttime, hrs_endtime, hrs_remarks, EXTRACT (epoch FROM hrs_normaltime) AS normal_time, EXTRACT(epoch FROM hrs_orttime) AS ort_time, prs_fullname FROM hrs_hours LEFT JOIN prs_personel ON hrs_hours.hrs_prs_fkey = prs_personel.prs_pkey WHERE hrs_prs_fkey = 6 AND EXTRACT(YEAR FROM "hrs_date" = 2015 AND ( EXTRACT(MONTH FROM "hrs_date" = 5 OR EXTRACT(MONTH FROM "hrs_date" = 6 OR EXTRACT(MONTH FROM "hrs_date" = 7 OR EXTRACT(MONTH FROM "hrs_date" = 7) ORDER BY hrs_date ASC, hrs_starttime ASC
Anyone know what the problem is here?