Query Prompt - Multiple Criteria 关注

0
Avatar
Legacy Poster

Hello,
I'm curious to know if it's possible to have multiple criteria at query prompt time when connected to a database. I currently have the below SQL working in a Bartender 8.01 Enterprise format.

[code]SELECT DISTINCT `WC`, `JOB #`, `ITEM` FROM `tblSchedule` WHERE `JOB #` = '?JOBNUM' [/code]

This query works as designed, but since we might have certain 'jobs' go through multiple 'workcells' (WC), then the format will print multiple records.
I would like to see something along the lines of...

[code]SELECT DISTINCT `WC`, `JOB #`, `ITEM` FROM `tblSchedule` WHERE `JOB #` = '?JOBNUM' AND 'WC' = '?WC'[/code]

This would allow me to get the correct number of records. When attempting this SQL statement, I do not get a 2nd query prompt and no records return as a result.

Any info or insight appreciated.
dbro34

1 评论

0
Avatar
Legacy Poster
评论操作 固定链接

[quote name='dbro34' timestamp='1329832226' post='1796']
Hello,
I'm curious to know if it's possible to have multiple criteria at query prompt time when connected to a database. I currently have the below SQL working in a Bartender 8.01 Enterprise format.

[code]SELECT DISTINCT `WC`, `JOB #`, `ITEM` FROM `tblSchedule` WHERE `JOB #` = '?JOBNUM' [/code]

This query works as designed, but since we might have certain 'jobs' go through multiple 'workcells' (WC), then the format will print multiple records.
I would like to see something along the lines of...

[code]SELECT DISTINCT `WC`, `JOB #`, `ITEM` FROM `tblSchedule` WHERE `JOB #` = '?JOBNUM' AND 'WC' = '?WC'[/code]

This would allow me to get the correct number of records. When attempting this SQL statement, I do not get a 2nd query prompt and no records return as a result.

Any info or insight appreciated.
dbro34
[/quote]


Figured it out. Just needed to remove the "Use a specific SQL statement" and use the query builder.

请先登录再写评论。