ASP code SQL syntax for querying fields of the array type in the Access Database

Source: Internet
Author: User

Today, I encountered a problem when modifying a previously developed website. Because of the functional requirements, the previous numeric field was changed to a text field, this field must contain IDs of multiple categories. Previously, this field only corresponds to one ID.

 

Website isASP VBLanguage, the database usesAccess

 

Foreground query after data type modificationCodeYou cannot use conditions such as Xid = 1. Because the field is changed to the text type, its value is in the array format, for example:

1, 2, 3, 4, 5

 

The preceding SQL query statement is:Select [ID] from [Table] Where Xid = 3

 

The corresponding query code should be changed:Select [ID] from [Table] Where ',' + Xid + ', 'like' %, 3, %'

 

Record it to avoid further manual turning.

 

By crazybruce

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.