Ask Your Question
0

How do I use input to select the criterion for a Query

asked 2015-09-05 14:50:57 +0200

I have a table with numerous customers and their transactions entered as transactions per row. I wrote a query that I use to select a customer so I can see just their transactions. That is making their customer number the criterion for the query. What I want to do is be able to input the customer number once I start the query so I don't have to write many queries for each customer.

edit retag flag offensive close merge delete

Comments

Hi, can you attach a example_file for understand better the problem ?

charlie.it gravatar imagecharlie.it ( 2015-09-05 21:16:42 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2015-09-05 23:09:01 +0200

peterwt gravatar image

You can use a parameter query to do this.
In the criteria enter :enterID
That is a colon followed by any text WITHOUT SPACES.
The SQL will look like SELECT "Table1".*, "Table1"."ID" FROM "Table1" WHERE "ID" = :enterID
When you run this query it will bring up a prompt with enterID and a box to enter the required customer ID.

edit flag offensive delete link more

Comments

here is a link to the help page with a little more information,

doug gravatar imagedoug ( 2015-09-07 04:33:54 +0200 )edit

Ok can I use this in a report? That is what I really need to do. At them moment I have created queries for each customer number and then use that query to create the report. I have over a hundred customers and this is real cumbersome. What I am trying to do is print a report for each days transactions in a table and the report will be just for the customer I want the report for. Each transaction in the table has the customers number associated with who the transaction was for.

Sparksvonrou gravatar imageSparksvonrou ( 2015-09-16 03:53:21 +0200 )edit

I want to run the report and input which customer and which date the transactions I want reported are for. Using the current days date is fine so that could be auto and does not have to be a input.

Sparksvonrou gravatar imageSparksvonrou ( 2015-09-16 03:54:49 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-09-05 14:50:57 +0200

Seen: 1,202 times

Last updated: Sep 05 '15