如何格式化字符串以使其与查询中的条件兼容 [英] How to Format Character String to Make it Compatible with Criteria in a Query

查看:56
本文介绍了如何格式化字符串以使其与查询中的条件兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个人的好日子


奇怪的问题我是客人,


我正在使用一个函数作为查询条件,函数只是得到一个全局变量的值所有这些工作但是ms访问没有接缝



这个例子(它指的是什么它在引号旁边)


property ="介于1和98之间


当我输入介于1和98之间作为标准查询设计工作正常。


我无法弄清楚是什么错误。


感谢您的帮助。

Good day to every one

Weird question i guest,

I''m using a function as a query criteria, that function simply get the value of a global variable all this worked of but is seams that ms access does not
understand

this an example (it refers to what it beside the quotation marks)

property = "Between 1 And 98"

When i type Between 1 And 98 as a criteria in the query design it works OK.

I can''t figure what wrong.

Thanks for your help.

推荐答案

你能发布你想要构建的查询的全文吗?您是否在代码中构建此查询?什么是提供在1和98之间。查询的字符串?
Could you post the full text of the Query you''re trying to build? Are you building this query in code? What is providing the "Between 1 and 98" string to the query?


感谢给我一个帮助。


可能我的解释不是很清楚。


我在查询设计中构建查询。


我用一个函数来获取一个全局变量的值,其值为Between 1并且98作为一个值。


当我从函数调用中获取值时,我在执行时遇到条件表达式错误中的数据类型不匹配。


当我在查询设计中手动输入相同的值时,查询工作正常。


i尝试单引号 ''介于1和98''之间它也没用。




谢谢。
Thanks to give me a hand on this.

May be my explanation was not quite clear.

I build the query in query design.

I used a function to get the value of a global variable which as "Between 1 And 98" as a value.

I''m getting a Data type mismatch in criteria expression error at the execution when i get the value from the function call.

When i type the same value by hand as i criteria in the query design the query worked ok.

i tried to put single quotation " '' Between 1 and 98 '' " it did not work either.




Thanks.


你需要发布你的代码正在使用,如果你不是它几乎不可能帮助你。从我们的角度来看,我们不知道你的代码是什么样的,所以我们怎么能告诉你它有什么问题。如果我给你一个错误但我没有给你产生错误的代码,你怎么回答。


-AJ
You need to post the code you are using, if you don''t it will be next to impossible to help you. Look at it from our view, we do not know what your code looks like, so how can we tell you what is wrong with it. If I give you an error I have but don''t give you the code that generates the error, how could you answer.

-AJ


这篇关于如何格式化字符串以使其与查询中的条件兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆