Hello,
I am having a problem as to where I am trying to do a search with three different search criterias
Date Range, StockNum, ConsignorNum
When I select the drop downs and lets say I choose 4 for stockum it returns all records with 4 in it. (example: 4, 124, 144, 1244, 4123, etc)Is there a way to get the record of number 4 to show instead all the records?
My date criteria works fine it is just these two searches not doing what I want. I use the following in the query:
For stock num:
Like "*" & [Forms]![CSearch]![StockNum] & "*"
For Consignor num:
Like "*" & [Forms]![CSearch]![ConsignorNum] & "*"
and my date search (datein):
Between nz([Forms]![Csearch]![DateMin],#1/1/1980#) And nz([Forms]![Csearch]![DateMax],#1/1/2200#)
and also here is the sql code for the query:
SELECT tblStockList.ConsignorNum, tblStockList.StockNum, tblStockList.DateIn, tblStockList.InvType, tblStockList.Description, tblStockList.Size, tblStockList.AskingPrice, tblStockList.SoldDate, tblStockList.SoldPrice, tblStockList.PaidDate, tblStockList.Returned, tblStockList.RetDate, qryConsignorName.Name
FROM tblStockList INNER JOIN qryConsignorName ON tblStockList.ConsignorNum = qryConsignorName.ConsignorNum
GROUP BY tblStockList.ConsignorNum, tblStockList.StockNum, tblStockList.DateIn, tblStockList.InvType, tblStockList.Description, tblStockList.Size, tblStockList.AskingPrice, tblStockList.SoldDate, tblStockList.SoldPrice, tblStockList.PaidDate, tblStockList.Returned, tblStockList.RetDate, qryConsignorName.Name
HAVING (((tblStockList.ConsignorNum) Like "*" & [Forms]![CSearch]![ConsignorNum] & "*") AND ((tblStockList.StockNum) Like "*" & [Forms]![CSearch]![StockNum] & "*") AND ((tblStockList.DateIn) Between nz([Forms]![Csearch]![DateMin],#1/1/1980#) And nz([Forms]![Csearch]![DateMax],#1/1/2200#) Or (tblStockList.DateIn) Between nz([Forms]![Csearch]![DateMin],#1/1/1980#) And nz([Forms]![Csearch]![DateMax],#1/1/2200#))) OR (((tblStockList.ConsignorNum) Like "*" & [Forms]![CSearch]![ConsignorNum] & "*") AND ((tblStockList.StockNum) Like "*" & [Forms]![CSearch]![StockNum] & "*") AND ((tblStockList.DateIn) Between nz([Forms]![Csearch]![DateMin],#1/1/1980#) And nz([Forms]![Csearch]![DateMax],#1/1/2200#) Or (tblStockList.DateIn) Between nz([Forms]![Csearch]![DateMin],#1/1/1980#) And nz([Forms]![Csearch]![DateMax],#1/1/2200#)));
thank you
I am having a problem as to where I am trying to do a search with three different search criterias
Date Range, StockNum, ConsignorNum
When I select the drop downs and lets say I choose 4 for stockum it returns all records with 4 in it. (example: 4, 124, 144, 1244, 4123, etc)Is there a way to get the record of number 4 to show instead all the records?
My date criteria works fine it is just these two searches not doing what I want. I use the following in the query:
For stock num:
Like "*" & [Forms]![CSearch]![StockNum] & "*"
For Consignor num:
Like "*" & [Forms]![CSearch]![ConsignorNum] & "*"
and my date search (datein):
Between nz([Forms]![Csearch]![DateMin],#1/1/1980#) And nz([Forms]![Csearch]![DateMax],#1/1/2200#)
and also here is the sql code for the query:
SELECT tblStockList.ConsignorNum, tblStockList.StockNum, tblStockList.DateIn, tblStockList.InvType, tblStockList.Description, tblStockList.Size, tblStockList.AskingPrice, tblStockList.SoldDate, tblStockList.SoldPrice, tblStockList.PaidDate, tblStockList.Returned, tblStockList.RetDate, qryConsignorName.Name
FROM tblStockList INNER JOIN qryConsignorName ON tblStockList.ConsignorNum = qryConsignorName.ConsignorNum
GROUP BY tblStockList.ConsignorNum, tblStockList.StockNum, tblStockList.DateIn, tblStockList.InvType, tblStockList.Description, tblStockList.Size, tblStockList.AskingPrice, tblStockList.SoldDate, tblStockList.SoldPrice, tblStockList.PaidDate, tblStockList.Returned, tblStockList.RetDate, qryConsignorName.Name
HAVING (((tblStockList.ConsignorNum) Like "*" & [Forms]![CSearch]![ConsignorNum] & "*") AND ((tblStockList.StockNum) Like "*" & [Forms]![CSearch]![StockNum] & "*") AND ((tblStockList.DateIn) Between nz([Forms]![Csearch]![DateMin],#1/1/1980#) And nz([Forms]![Csearch]![DateMax],#1/1/2200#) Or (tblStockList.DateIn) Between nz([Forms]![Csearch]![DateMin],#1/1/1980#) And nz([Forms]![Csearch]![DateMax],#1/1/2200#))) OR (((tblStockList.ConsignorNum) Like "*" & [Forms]![CSearch]![ConsignorNum] & "*") AND ((tblStockList.StockNum) Like "*" & [Forms]![CSearch]![StockNum] & "*") AND ((tblStockList.DateIn) Between nz([Forms]![Csearch]![DateMin],#1/1/1980#) And nz([Forms]![Csearch]![DateMax],#1/1/2200#) Or (tblStockList.DateIn) Between nz([Forms]![Csearch]![DateMin],#1/1/1980#) And nz([Forms]![Csearch]![DateMax],#1/1/2200#)));
thank you