How to write Case Sensitive Query for MS Access?

后端 未结 5 1387
耶瑟儿~
耶瑟儿~ 2020-12-03 22:49

I want to know the Select Query for MS Access with case sensitive.

I have two values for VitualMonitorName as below

VCode VirtualMonitorName
Row 1 (1         


        
5条回答
  •  半阙折子戏
    2020-12-03 22:52

    Using only built-in functions, add an additional custom column in the query design view:

    location: InStr(1,[VCode],"VM1",0)
    

    the zero parameter requests binary compare (case sensitive) when finding location of "VM1" within [VCode]

    set the criteria in that column to >0 so only records with non-zero location in the vcode matching Like "*vm*" contain the exact VM1 string -

    The WHERE clause looks like:

    WHERE (((VirtualMaster.VCode) Like "\*vm*") AND ((InStr(1,[VCode],"VM1",0))>0));
    

提交回复
热议问题