Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

Report SQL Criteria

Questions related to nuBuilder Forte Reports and the Report Builder.
Post Reply
acroporax
Posts: 42
Joined: Thu Apr 21, 2022 3:04 pm
Has thanked: 5 times
Been thanked: 1 time

Report SQL Criteria

Unread post by acroporax »

Hi,
I have 1 SQL in project and this sql is report source. But Where condition not working! Report is empty..

SELECT
havale_takip.*,
cariler.Cari_Ad

FROM
havale_takip
JOIN cariler ON cariler.Sirket = havale_takip.Sirket AND havale_takip.Cari_Kod = cariler.Cari_Kod

WHERE
((HavaleTakipNo =(select havaleid from param where user='#USER_ID#')))
acroporax
Posts: 42
Joined: Thu Apr 21, 2022 3:04 pm
Has thanked: 5 times
Been thanked: 1 time

Re: Report SQL Criteria

Unread post by acroporax »

how can i use parameter in report
kev1n
nuBuilder Team
Posts: 4581
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 536 times
Contact:

Re: Report SQL Criteria

Unread post by kev1n »

Does the SQL return the desired rows when you run the SQL in phpMyAdmin? (Of course, replace #USER_ID# with a user id)
acroporax
Posts: 42
Joined: Thu Apr 21, 2022 3:04 pm
Has thanked: 5 times
Been thanked: 1 time

Re: Report SQL Criteria

Unread post by acroporax »

What is this

[0] :
===USER==========

globeadmin

===PDO MESSAGE===

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nubuilder4.___nu162a385afb2d51___' doesn't exist

===SQL===========

SELECT * FROM (SELECT * FROM ___nu162a385afb2d51___ ) AS tmp

===BACK TRACE====

/var/www/core/nurunpdf.php - line 250 (nuRunQuery)

/var/www/core/nurunpdf.php - line 68 (nuBuildReport)

/var/www/core/nurunpdf.php - line 23 (nuRunReportId)
acroporax
Posts: 42
Joined: Thu Apr 21, 2022 3:04 pm
Has thanked: 5 times
Been thanked: 1 time

Re: Report SQL Criteria

Unread post by acroporax »

ok, problem is solved.
kev1n
nuBuilder Team
Posts: 4581
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 536 times
Contact:

Re: Report SQL Criteria

Unread post by kev1n »

How did you solve it?
acroporax
Posts: 42
Joined: Thu Apr 21, 2022 3:04 pm
Has thanked: 5 times
Been thanked: 1 time

Re: Report SQL Criteria

Unread post by acroporax »

Changed SQL, I use #record_id# in the new sql. #record_id# is worked but #user_id# didn't work. But no problem because report is working.

Thank you so much..

SELECT
havale_takip.Cari_Kod,
havale_takip.Vade_Tarihi,
havale_takip.USD,
havale_takip.TL,
havale_takip.Durum,
havale_takip.Banka,
havale_takip.HavaleTakipNo,
havale_takip.AlacakID,
havale_takip.Kur,
havale_takip.Sirket,
havale_takip.havalerecordid,
cariler.Cari_Ad

FROM
havale_takip
JOIN cariler ON havale_takip.Cari_Kod = cariler.Cari_Kod

WHERE
((havale_takip.havalerecordid = '#RECORD_ID#'))
Post Reply