Tải bản đầy đủ - 0 (trang)
Hack 50. Use Wildcards in Queries

Hack 50. Use Wildcards in Queries

Tải bản đầy đủ - 0trang

evenjustthatanameisfourcharacterslong,butyoudon't

rememberanyoftheactualcharacters!Insuchascase,usinga

criterionofLike"????"returnsallcustomerswithlastnamesthat

arefourcharacterslong,asshowninFigure5-44.



Figure5-41.Findingcustomerswithanasterisk

wildcard



Figure5-42.Findingcustomersusingquestion

marks



Figure5-43.Returningrecordsbasedonthe

wildcards



Figure5-44.Returningallcustomerswithalast



namefourcharacterslong



Hack51.GetCleanerOr-BasedCriteria



Avoidusingmultiplerowsinthequerygridbyusingthe

Inoperator.

TheAccessquerygridisdesignedforeasyqueryassembly,and

itdoesagreatjob.Withoutadoubt,thegridhasbeenan

essentiallearningtoolthathelpsusunderstandanduse

queries.

YoucanusethegridtocreateOr-basedcriteriaintwoways.

Figure5-45showsatypicalwaytosetupaquery.Inthiscase,

thequeryreturnsrecordsinwhichthestateisanyofsix

possiblevalues.Asyoucansee,however,ifafewmorestates

weretobeincluded,itwouldbecomenecessarytostart

scrollingverticallytoworkonthelistofstates.



Figure5-45.CreatingOr-basedcriteria



Figure5-46showsanalternatewaytosetuptheOrcriteria.

Thespecifiedstatesareputononerow,withOrstatements

throughout.However,thisdesignalsosuffersfrombecoming

unwieldyifmorestatesareadded.Eachadditionalstatebeing

addedalsorequiresanotherOroperator,sotheexpressioncan

becomequitelong.



Figure5-46.Alongcriteriastatement



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Hack 50. Use Wildcards in Queries

Tải bản đầy đủ ngay(0 tr)

×