Query impossibility?

  • Thread starter Thread starter swvermeulen
  • Start date Start date
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
 
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*";
 
Back
Top