1. Akini Ross
  2. Report Editor
  3. Dienstag, August 18 2015, 11:05 AM
  4.  Abonnieren via E-Mail
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?
Kommentar
There are no comments made yet.
Akini Ross Akzeptierte Antwort
Sorry underling and bold did not go right

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?
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
Hi Akini,

* Query looks correct.
* Its hard to see where this can be fault of Valentina, because query is sent to DB as is,

* You can try replace that part to
AND EXTRACT(MONTH FROM "hrs_date";) IN (5,6,7)
Kommentar
There are no comments made yet.
  • Seite :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories