Query impossibility?

S

swvermeulen

I have got 3 tables

A table called a table called T_PaperSize with the column PaperSize
filles with
A4, A3, A2, A1, A0

a table called T_PaperSizeName with the columns PaperSize and SizeName

example of table 'T_PaperSizeName'
PaperSize = A4, SizeName = A4
PaperSize = A4, SizeName = 210x297
PaperSize = A4, SizeName = A4 (210x297)
PaperSize = A3, SizeName = A3
etc

and a table called T_printer with the colums
PrinterLocation,PaperSize,SizeName
in the table T_printer I have to fill out for every printer/plotter the
location, papersizes, sizenames

*PrinterLocation is normal text field
*PaperSize (lookup field) contains query which lists the papersizes from
table
T_PaperSize in a listbox
*SizeName must be a lookup field which shows a listbox

here is my question:
if the papersize is A4 it should only show the sizenames of where in table
T_PaperSizeName the papersize name is A4 how can I do that??
Is it possible to insert the papersize cell of the current row as a parameter?

the only thing I managed was to load the whole list of SizeNames

please help


greetings Simone
 
K

Ken Snell [MVP]

This select query should give you the desired results if you want the
PaperSize value to exactly equal A4:

Select T_PaperSize.PaperSize, T_PaperSizeName.Sizename
FROM T_PaperSize INNER JOIN T_PaperSizeName
ON T_PaperSize.PaperSize = T_PaperSizeName.PaperSize
WHERE T_PaperSizeName.SizeName = "A4";


Otherwise, if you just want the PaperSize value to contain the A4 string:

Select T_PaperSize.PaperSize, T_PaperSizeName.Sizename
FROM T_PaperSize INNER JOIN T_PaperSizeName
ON T_PaperSize.PaperSize = T_PaperSizeName.PaperSize
WHERE T_PaperSizeName.SizeName Like "*A4*";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top