Hi everyone, I developed a query that acts as a datasource for a report but I need some help with finalising the where clause. the two tables in question have a one to many relationship for example the production table has 1 row of data with these 2 fields:
First Serial = 624
Last Serial = 642
and Table A could have multiple rows with serial numbers that fall between the range of 000624 - 000642.
At present the leading zeros are not entered into the First and Last serial fields, but the serial number field in table A contains all serial digits e.g. 000631, how do I compare my serial number from table A to see if its >= First Serial or <= Last Serial from my production table? This is what I have so far:
Thanks for helping!!
First Serial = 624
Last Serial = 642
and Table A could have multiple rows with serial numbers that fall between the range of 000624 - 000642.
At present the leading zeros are not entered into the First and Last serial fields, but the serial number field in table A contains all serial digits e.g. 000631, how do I compare my serial number from table A to see if its >= First Serial or <= Last Serial from my production table? This is what I have so far:
Code:
WHERE ((((tblQuantum.DateEntered) Between [forms]![frmReports]![StartDate] And [forms]![frmReports]![EndDate])
AND (tblQuantum.SerialNumber) >= Assembly_tblProduction.FirstSerial AND <= Assembly_tblProduction.LastSerial)
AND ((tblQuantum.ProductCode) Like "*" & [Forms]![frmReports]![ProductCode] & "*")
AND ((tblQuantum.BatchNumber) Like "*" & [Forms]![frmReports]![BatchNumber] & "*"));
Thanks for helping!!